c++ - How to push_back multiple values into a vector? -
i know question has been asked before, , know in c++11 can do
vector<int> v = {2,5,8,11,14}; vector<int> v{2,5,8,11,14};
and
v.push_back({x,y});
but gives me compile error. i'm using visual studio express 2012.
how accomplish this?
edit: error screenshot attached:
visual studio 2012 does not support vector initialization via initializer lists. there lot of c++11 support missing standard library included vs2012 supported vs2012 c++ compiler itself.
sadly, case vs2012 , case gcc 4.7, awesome compiler support new c++11 features hampered partial library support seems lag behind compiler.
Comments
Post a Comment