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

Popular posts from this blog

php - How can I merge Nodes & Webform Submissions into instances of one general Content Type in Drupal 6? -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

geospatial - MongoDB Bound Queries: How do I convert mile to radian? -