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:

enter image description here

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

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -