class Road {
private:
std::vector<Vehicle*> container;
public:
std::vector<Vehicle*> getContainer(){
return container;
}
virtual void operator+(Vehicle *vehicle)=0;
};
class Highway: public Road {
public:
virtual void operator+(Vehicle *vehicle) {
getContainer().push_back(vehicle);
}
};
Why do I get an error that I cannot allocate an object of abstract type when all of my virtual functions are overriden?
It happens when I try to call Road r = Highway();
in my main class.