I was reading the C++0x faq and came across the section detailing initializer lists. The examples were mostly variations of:
vector<int> vi = { 1, 2, 3 };
vector<int> vj({1, 2, 3});
// etc.
However, also listed was the form:
vector<int> vk{2};
This form appears elsewhere in the faq, and I am curious as to whether it is semantically different from the initial two forms, or just syntactic sugar for vk({x, y, z}).
One is uniform initialization, and the other is initializer lists. They are two different things, although as you can see, they can produce similar syntax.
is a uniform initialization- the other two are initializer lists.