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

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

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