I have been looking for this in N4713 for more than two hours to no avail.
I have a C++14 draft which says, at 7.1.6.1 [dcl.type.cv]:
As described in 8.5, the definition of an object or subobject of const-qualified type must specify an initializer or be subject to default-initialization
8.5 [dcl.init] says (clause 7):
To default-initialize an object of type T means:
[for a non class, non array type]:
... no initialization is performed
And immediately follows with:
If a program calls for the default initialization of an object of a const-qualified type T, T shall be a class type with a user-provided default constructor.
Therefore a const
built-in must have an initializer, since otherwise it would be default-initialized and that is not allowed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With