c向量矢量投射

class Interface{};

class Foo: public Interface{};

class Bar{
public:
    vector<Interface*> getStuff();
private:
    vector<Foo*> stuff;
};

如何实现getStuff()函数?

vector<Interface*> result(stuff.begin(), stuff.end());
return result;
相关文章
相关标签/搜索