Intellisense not working with abstract class
When I create an inherited class
For example :
class Base {public: virtual void foo() = 0;};
class Derived :public Base{void foo() override { }}
std::vector < Base > Objects; // <-- This does not error here even though the base object cannot be constructed.
std::vector < Base* > Objects; // <-- This is the right way to do it.
请先登录再写评论。
Using inheritance, we have to write the functions only one time instead of three times as we have inherited rest of the three classes from base class (Vehicle).