class myClass {
const std::vector<int> myVec = {1,1}; //works
//const std::vector<int> myVec (2,1); //doesn't work
}
I'm trying to define a constant vector in a class.
Why the first line works while the second line doesn't?
The error is
g++ test.C
test.C:6:35: error: expected identifier before numeric constant
const std::vector<int> myVec (2,1);
^
test.C:6:35: error: expected ',' or '...' before numeric constant