to sum up my problem, lets say I have this:
class Base {};
class Derived_one : public Base {
private:
Polymorphic_vector arr;
public:
const Polymorphic_vector& get_arr() const{
return this->arr;
}
};
class Derived_two : public Base {};
//Polymorphic_vector.hpp
#include "Base.hpp"
class Polymorphic_vector : public std::vector<Base*> { //some overrided f-ns };
class Foo {
//here i want to have the ability of sth like this
//this->at(int position)->get_arr();
//i.e. call get_arr()
};
//end of Polymorphic_vector.hpp
In the polymorphic vector I have pointers to objects of type Derived_one and Derived_two. I want to call get_arr() in Foo. But in order to be able to do that, I should have it as a virtual f-n in class 'Base' and override it in the derived ones. But, since those classes are in different .hpp files, I would have to include "Polymorphic_vector.hpp" in 'Base', because the f-n get_arr() return a value of type Polymorphic_vector. But I already have 'Base' included in 'Polymorphic_vector'. So yeah, thats it :D I would love to receive some feedback about how to solve that problem, thank you.