I would like to have a 2D static vector that can be extended in one direction. A static vector of array sounded right to me:
struct A
{
public:
static std::vector<std::array<float, 3> > theTable;
};
I tried to access it from main with:
A::theTable.push_back({0.0, 0.0, 0.0});
But I get "no matching function for call to std::vector<std::array<float, 3ul> >::push_back(<brace-enclosed initializer list>)"
How can I declare this vector of array and then use if properly from anywhere else?
it looks like you have not defined theTable
struct A
{
public:
static std::vector<std::array<float, 3> > theTable;
};
std::vector<std::array<float, 3> > A::theTable; //define
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With