Can't make a vector of a class containing a ptr_vector<an_abstract_class>
问题 I need to have a std::vector of boost::ptr_vector s. To make their management easier, I enclosed the boost::ptr_vector in a class ( Zoo ) and made a std::vector of it ( allZoos ). Look at a minimal code for reproducing this: #include <boost/ptr_container/ptr_vector.hpp> #include <boost/utility.hpp> class Animal { public: virtual char type() = 0; }; class Cat : public Animal { public: char type() { return 1; } }; class Zoo { public: boost::ptr_vector<Animal> animals; }; int main() { std: