I\'ve been going through \'A Tour of C++\' and Bjarne uses the the c++11 initializer list feature in member initialization in a constructor, like so (using curly brackets):<
The short description is: the notation in the member initializer list matches that of variables initialized elsewhere. Sadly, the description of what it does is not as easy at all because there are two somewhat conflicting changes relating to the use of curly braces for constructor calls:
std::initializer_list without an extra pair of parenthesis/curly braces. If there is a constructor taking an std::initializer_list (for a suitable type T) this constructor is used when using curly braces.Put differently, if there is no std::initializer_list constructor but some other user defined constructor the use of parenthesis and curly braces is equivalent. Otherwise it calls the std::initializer_list constructor. ... and I guess, I'm missing a few details as the entire initialization is actually quite complicated.