Where does the C ++ standard say that the definition of a constant of the built-in type const should be initialized?

I searched this in N4713 for more than two hours to no avail.

+4
source share
2 answers

I have a C ++ 14 project that states: 7.1.6.1 [dcl.type.cv]:

As described in 8.5, the definition of an object or subobject const-qualified type must indicate an initializer or be subject to initialization by default

8.5 [dcl.init] says (section 7):

To initialize an object of type T by default:

[for type non-type, non array]:

... initialization fails

And immediately follows:

If the program calls the default initialization for an object of type const, type T, T must be a class type with a user-supplied default constructor.

a const , .

+9

N4713 [dcl.init] 11.6/7:

const-type T, T const-default- .

. , const , "" .

+4

Source: https://habr.com/ru/post/1694292/


All Articles