October 2011
Beginner to intermediate
1200 pages
35h 33m
English
As with arrays, C++11 extends the features of list-initialization. The = sign is optional:
inflatable duck {"Daphne", 0.12, 9.98}; // can omit the = in C++11
Next, empty braces result in the individual members being set to 0. For example, the following declaration results in mayor.volume and mayor.price being set to 0 and all the bytes in mayor.name being set to 0:
inflatable mayor {};
Finally, narrowing is not allowed.
Read now
Unlock full access