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

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

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