Aggregate initialization
-
Aggregate is any of following type:
- array type
- class type (struct or union) that has NO
- private, protected non-static data members
- user-declared constructors (explicitly defaulted or deleted constructors are allowed)
- virtual, private, or protected base classes
- virtual member functions
- default member initializers
Type of initialization
| Type | What | Code |
|---|---|---|
| Designated initializers | Each designator must name a direct non-static data member of T. Order of designator should be same as order of the data members of T | |
| Character Arrays | If the size of the array is specified and it is larger than the number of characters in the string literal, the remaining characters are zero-initialized | |