Are these vector definitions "permanent initialization"?
This question is about the code (in the namespace area):
std::vector<int> v1;
std::vector<int> v2(4);
Section 3.6.2 C ++ 14 (N4140) defines the term Constant initialization:
Continuous initialization is performed:
- [omitted - about link initialization]
- if an object with a static or storage duration of threads is initialized by calling the constructor, and if the full initialization expression is a constant initializer for the object,
- if the object with the statics or duration of the storage of the stream is not initialized by calling the constructor, and if either the object is initialized with a value or any complete expression that appears in its initializer is a constant expression.
In addition, the term constant initializer is defined only earlier:
o- , , , constexpro, .
, std::vector<int> v2(4).
, . 4. 4 - , . , , .
, , , v2 .
v1 , " "; , .
: v1 v2 ; , , ?