All challenges
Multiple ChoiceIntermediate 45s

Aggregate initialization rules

Which class qualifies as an aggregate in C++17 (eligible for brace aggregate init)?
Options
  1. 1Any class at all, as long as it happens to declare some form of default constructor.
  2. 2One with no user-provided/deduced constructors, no private/protected non-static data members, no virtual functions, and no virtual/private/protected base classes.
  3. 3Any class whose members are all public, even if it declares its own user-defined constructors.
  4. 4Only POD structs that have no constructors of any kind and whose members are all trivial.

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle