Or is it just me who's really gone senile? This isn't working for me:
std::vector<int> someNumbers = { 1, 3, 5, 7, 9 };
std::vector<int> someNumbers[] = { 1, 3, 5, 7, 9 };
std::vector<int> someNumbers() = { 1, 3, 5, 7, 9 };
std::vector<int> someNumbers = { 1, 3, 5, 7, 9 }
Tried a few other variations as well. It says that "someNumbers must be initialized by constructor, not by {...}"
So, what am I doing wrong? :/
Last edited on
That syntax won't work in ISO C++ 2003 but it will work on C++0x ( which is going to be officially standardized in the next few years )