Is there anything wrong with pushing back a vector of vectors? like
typedef vector<Point> Polygon; vector<Polygon> polys; polys.push_back(some_poly);
All the elements in some_poly will be copied right?
I have a bug in my code and I can’t seem to figure out what’s wrong with it.
Yes, that should work fine, as long as you have defined a copy constructor and assignment operator for your Point class (and ensured they’re doing the right thing etc). std::vector will push just fine, so the bug must be elsewhere – obviously we’d need more details to help further.
There are performance implications if you’re going to push a vector of things, but don’t worry about that until it’s working (and then only if it becomes a problem).