C++相談室 part83
■ このスレッドは過去ログ倉庫に格納されています
0294デフォルトの名無しさん
2010/08/29(日) 17:39:51http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3126.pdf
8.5.1 Aggregates の 第7節
7 If there are fewer initializer-clauses in the list than there are members in the aggregate, then each member
not explicitly initialized shall be value-initialized (8.5).
8.5 Initializers の 第7節
7 To value-initialize an object of type T means:
...省略...
— if T is a (possibly cv-qualified) non-union class type without a user-provided constructor, then the object
is zero-initialized and, if T’s implicitly-declared default constructor is non-trivial, that constructor is
called.
8.5 Initializers の 第5節
5 To zero-initialize an object or reference of type T means:
...省略...
— if T is a (possibly cv-qualified) non-union class type, each non-static data member and each base-class
subobject is zero-initialized;
8.5 Initializers の 第5節
5 To zero-initialize an object or reference of type T means:
— if T is a scalar type (3.9), the object is set to the value 0 (zero), taken as an integral constant expression,
converted to T;
ってことで仕様で決まってます
上のPDFは0xのものだけど引用部分は03規格とだいたい同じです(03最終草案とはちょっと違います)
■ このスレッドは過去ログ倉庫に格納されています