In that article, I wrote that a pure virtual function is “a method which is declared by the base class, but for which no implementation is provided.” That statement is false. You can provide an implementation for a pure virtual method in C++.
A pure virtual function or pure virtual method is a virtual function that is required to be implemented by a derived class if the derived class is not abstract. Classes containing pure virtual methods are termed "abstract" and they cannot be instantiated directly.
A pure virtual function makes it so the base class can not be instantiated, and the derived classes are forced to define these functions before they can be instantiated. This helps ensure the derived classes do not forget to redefine functions that the base class was expecting them to.
I declare some class with pure virtual methods and make some classes derive it. Is there any way in Eclipse CDT to locate the pure virtual functions of the parent class and auto complete the declaration of the children class, just like in the java development? Having to go back and forth copying and pasting those functions is getting tiresome
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With