I realize this post is a month old, but I’ve had exactly the same issue: no success using list initialization with vectors.
If I use the “old” = notation, i.e.:
std::vector V = {1,2,3};
I get the error:
error: non-aggregate type ‘std::vector’ cannot be initialized with an initializer list.
If I use the new-in-C++11 notation:
std::vector V {1,2,3};
I get the error:
error: expected ‘;’ at end of declaration std::vector V {1,2,3};
(The second error comes whenever I try to use list initialization, i.e. curly braces, for any type.) Is this a known limitation, and something we shouldn’t expect changed until Root 6? Or should this work? If the latter, perhaps it’s relevant that when I try to #include <initializer_list>, I get a slew of errors, most of this form:
Error: Unexpected end of file (G__fgetname():2) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…
/lib/c++/v1/__config:3:
The errors mentioned earlier, however, come when I remove the <initializer_list> include directive. Unlike the OP, I’m running Root 5.34.11 cloned from github, with ./cofigure --all --with-finkdir=/usr/local/bin/brew. The machine is an Ivy Bridge rMBP, with OS X 10.9.
Any feedback appreciated,
Patrick