unqiue_prt declartion

Greetings and salutations! I've declared this:

std::unique_ptr<std::vector<Piece*>> formations;

The idea behind it was that it can hold anything derived from Piece without object slicing. Will that work?
Thanks for your time
A vector that can hold (pointers to) anything derived from Piece (without object slicing):
std::vector< std::unique_pointer<Piece> > formations ; // note: Piece must have a virtual destructor
I'm laughing at myself. Thank you my friend
Topic archived. No new replies allowed.