question about vectors

So I have one class called Object(){} and a ton of child classes that inherit from it.

my question has to do with managing all of them. I want to put all objects into a vector that i can iterate through to update animation, position, collision etc.(it's a game). my question is, if i create a vector<object>ObjectVector, can i then add child class objects (such as newEnemy, newNPC, etc.) to that vector?

thanks in advance
Yes, but you need to be using pointers (C++ != Java):

vector<Object*> objectVector; // insert any child of Object here

Reason?
stl is based on value-semantics and all objects passed into vector must be of the same sizeof().
thank you very much!
Topic archived. No new replies allowed.