Aggregate initialization Aggregate initialization Aggregate initialization initializes aggregate types. CMakeLists.txt 1 2add_executable(aggregate_initialization aggregate_initialization.cpp) target_compile_features(aggregate_initialization PRIVATE cxx_std_20) An aggregate type 1 2 3 4 5struct A { int x; int y; int z; }; Initialize type with designated initializers 1A a{.x = 1, .y = 4, .z = 2}; List initialization 1A c{1, 2, 3}; Nested type 1 2 3 4 5struct B { int x; A y; int z; }; Nested initialization 1B d{.x = 1, .y = {2, 6, 5}, .z = 3}; Share Snippets