30 Aug
2009
30 Aug
'09
4:31 p.m.
given the class like the one below: template <typename T> class animal { public: animal (const char* ofname) : _name(ofname) {} private: typedef T _T; std::string _name; _T behavior; } class MeatEater {}; class GrassEather {}; animal<MeatEater> bear ("bear"); animal<GrassEater> rabbit ("rabbit"); How to store "bear" and "rabbit" instances in a vector? Advise is greatly appreciated.