Jan 4, 2020 in C Plus Plus
Q: Aggregate member initialization C++ 14 features

1 Answer

0 votes
Jan 4, 2020
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
Jan 4, 2020 in C Plus Plus
  • #c
  • 14
  • 1
+1 vote
Jan 4, 2020 in C Plus Plus
+1 vote
Jan 4, 2020 in C Plus Plus
...