Since C++17, aggregates can have base classes, so that for such structures being derived from other classes/structures list initialization is allowed:
struct MoreData : Data {
bool done;
};
MoreData y{{"test1", 6.778}, false};
In C++17 an aggregate is defined as
- either an array
- or a class type (class, struct, or union) with:
- no user-declared or explicit constructor
- no constructor inherited by a using declaration
- no private or protected non-static data members
- no virtual functions
- no virtual, private, or protected base classes
For more details you can refer to Chapter 4 Aggregate Extensions from C++17 - The Complete Guide By Nicolai M. Josuttis