Aggregate initialization is a type of initialization which is used to initialize an aggregate datatype such as struct, std::array, etc. In aggregate initialization, we provide an initializer list containing values to initialize aggregate datatype members. Data members are then initialized with the values from the list in the order they are defined in struct. For example:
struct Pixel
{
int x{};
int y{};
};
Pixel a{1, 9};So, x would be initialized with 1 and y with 9 as per the order.