Top "Aggregate-initialization" questions

Aggregate initialization is a feature of C++ that allows the initialization of arrays and aggregate types using a curly brace syntax.

Initializing a member array in constructor initializer

class C { public: C() : arr({1,2,3}) //doesn't compile {} /* C() : arr{1,2,3} //doesn't compile either {} */ private: int arr[3]; }; I believe the reason is …

c++ c++11 initializer-list ctor-initializer aggregate-initialization
Narrowing conversions in C++0x. Is it just me, or does this sound like a breaking change?

C++0x is going to make the following code and similar code ill-formed, because it requires a so-called narrowing conversion …

c++ c++11 survey aggregate-initialization
Deleted default constructor. Objects can still be created... sometimes

The naive, optimistic and oh.. so wrong view of the c++11 uniform initialization syntax I thought that since C++11 user-defined …

c++ c++14 language-lawyer list-initialization aggregate-initialization
C++11 aggregate initialization for classes with non-static member initializers

Is it allowed in standard: struct A { int a = 3; int b = 3; }; A a{0,1}; // ??? Is this class still aggregate? clang accepts …

c++ c++11 gcc c++14 aggregate-initialization