Nope, consider you have two classes "Armor" and "Weapon" derived from "Object", and want to store them in single container. If you change container type to vector<Weapon>, you will not be able to store Armor in it.
Vector of automatic pointers is the best solution to this.
Thanks for all the replies. JLB's way is what I was looking for, but what if I wanted to add items statically?
For example, if you kill someone and click a button, their inventory will be added to yours. You can't just declare vector.pushback(std::make_shared<TYPE> every time because you don't know what type it'll be; it could be a Weapon or a Consumable.
Is there another way or am I just using this wrong? Because every item will be from a class derived Object; just with different functions and stats.
Quick note, the way to added inventory with the "&" operator didn't work (violation accessing memory), but making the classes pointers using new and adding them worked. Not sure why. But still, thanks!