c++ cast vector<Inherited*> to vector<abstract*> -
class interface{}; class foo: public interface{}; class bar{ public: vector<interface*> getstuff(); private: vector<foo*> stuff; }; how implement function getstuff()?
vector<interface*> result(stuff.begin(), stuff.end()); return result;
Comments
Post a Comment