+1 vote
in C Plus Plus by
Aggregate member initialization C++ 14 features

1 Answer

0 votes
by
C++11 added member initializers, expressions to be applied to members at class scope if a constructor did not initialize the member itself. The definition of aggregates was changed to explicitly exclude any class with member initializers; therefore, they are not allowed to use aggregate initialization.

C++14 relaxes this restriction, allowing aggregate initialization on such types. If the braced init list does not provide a value for that argument, the member initializer takes care of it.

Related questions

+1 vote
asked Jan 4, 2020 in C Plus Plus by AdilsonLima
+1 vote
asked Jan 4, 2020 in C Plus Plus by AdilsonLima
+1 vote
+1 vote
asked Jan 4, 2020 in C Plus Plus by AdilsonLima
...