On Sun, Mar 22, 2009 at 5:10 PM, Adam Langley <[email protected]> wrote:
> struct s a = {0}; will initialise all members of the structure to zero.
>
Correct. The C++ Standard, §12.6.1 (Explicit initialization) paragraph 2
says:
When an aggregate (whether class or array) contains members of class type
> and is initialized by a brace-enclosed initializer-list (8.5.1), each such
> member is copy-initialized (see 8.5) by the corresponding
> assignment-expression. If there are fewer initializers in the
> initializer-list than members of the aggregate, each member not explicitly
> initialized shall be default-initialized (8.5).
That takes care of the members of class type. Those that aren't are taken
care of by §8.5.1 (Aggregates) paragraph 7:
If there are fewer initializers in the list than there are members in the
> aggregate, then each member not explicitly initialized shall be
> default-initialized (8.5).
>
Avi
--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: [email protected]
View archives, change email options, or unsubscribe:
http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---