Quick A: Because the default assignement operator knows only the type of your object, which it can get be calling the constructor.
Recently on SO:
What is the point of calling constructor with implicit conversion instead of assignment operator after an object is initalized?
There is no implicit
box = 2.0;has to create a temporary
CBoxobject. It's equivalent to
box = CBox(2.0);.
Making your constructor
explicitdisallows the implicit conversion from
CBox, so no appropriate assignment operator exists, and you get a compile error.