I'm just wondering whether there is a simple, quick way to insert the elements of a vector of vectors inside a vector.
For example:
std::vector<std::vector<double> > vals
{
{1, 2, 3, 4, 5, 6},
{1, 2, 3, 4, 5, 6}
};
std::vector<double> myvector;
so myvector
would then contain: 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6
I've tried using insert
and push_back
but had no luck.
Edit:
I have used:
myvector.insert(vals.begin(), vals.end());
- No matching member function to call to 'insert'