I need to create a vector where each value is in fact four values. So good old Google led me to these pages:
Cant make a vector of fixed size arrays?
From these threads I'm led to believe it is optimal with the following syntax:
std::vector> arrayVector;
That part seems to work, but now I'd like to add my first row of values:
arrayVector.push_back({ 0, 1, 2, 3 });
And that part does not compile:
Severity Code Description Project File Line Suppression State
Error (active) no instance of overloaded function "std::vector<_Ty, _Alloc>::push_back [with _Ty=std::array, _Alloc=std::allocator>]" matches the argument list
I've also tried creating the int array as a separate variable and passing that variable to the push_back, also with the same result.
I'm using Microsoft Visual Studio Community 2015, I'm not one to normally choose C++, so I might be missing something obvious. Thanks in advance.
No comments:
Post a Comment