I have some double variables: a, b,c... I want to construct a vector v such as v[0]=a, v[1]=b etc Can I do this with C++11 list initializer ? i.e this syntax :
std::vector<double> v{a,b,c};
If no, is there a way to do this directly, without multiple pushback() ?
You can answer questions like this easily using this online C++ compiler: http://webcompiler.cloudapp.net/
I tried this and it worked: