Y
Yan
The ISO standard says (in 8.5 [dcl.init] paragraph 9):
If no initializer is specified for an object, and the object is of
(possibly cv-qualified) non-POD class type (or array thereof), the
object shall be default-initialized; if the object is of
const-qualified type, the underlying class type shall have a
user-declared default constructor.
Does anybody know what is the rationale behind forcing a programmer to
define a default constructor in this case? Why is it that the object
being of const type makes it a special case?
Thank you.
If no initializer is specified for an object, and the object is of
(possibly cv-qualified) non-POD class type (or array thereof), the
object shall be default-initialized; if the object is of
const-qualified type, the underlying class type shall have a
user-declared default constructor.
Does anybody know what is the rationale behind forcing a programmer to
define a default constructor in this case? Why is it that the object
being of const type makes it a special case?
Thank you.