I have been using the following vector initialization with values in Code::Blocks and MingW compiler:
vector<int> v0 {1,2,3,4};
After that I had to move the code to a visual studio project (c++) and I tried to build. I got the following error:
local function definitions are illegal
Visual Studio compiler does not support this kind of initialization?
How do I need to change the code to make it compatible?
I want to initialize vector and fill it with values at the same time, just like an array.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…