But in the mean time you think that your test method is incomplete and you don't want to add anything in that class then simply declare the class Abstract.
Your next Developer or may you will inherit it and there it will implementation.
Abstract means a class which is incomplete.
You cannot declare a class abstract. What you can do is declare a class with a pure virtual function. That prevents the method from being called with an object of that class. This, in turn, cause the compiler to prevent you from creating objects of that class. Mayvbe that's what you meant by abstract. You cannot have an incomplete test() method in the base class and add to it in a derived class.
The derived class needs to override the bast class test method and thereby loses the code in the base class test method. To recover it you must code in the derived class:
[code=cpp]
Derived::test()
{
this->A::test(); //recover base class functionality
}
[/code}
This is bad design since it is not clear of the A::test() should be called before (a pre-condition) or called after ( a post-condition) the derived class test() logic. Now you have ambiguity. Ambiguity is a sign of bad design.
As a general rule:
Do not derive from concrete classes.
More, class A has no virtual destructor. A class with no virtual destructor cannot be used as a base class having virtual functions. When you create a derived object, only the destructor of the derived object will be called. The base class destructor will never be called so the object is not properly cleaned up.
Even more, virtual functions should not be public. They declare how the class is implemented. The functions of the base class declare the interface to the hierarchy. By making then virtual, you destroy the interface in favor of the implementation. Worse, it forces all derived classes tio implement methods they may not be able to support.
The base class public methods are not to be virtual. Instead, they can call base class private virtual methods and it is these that the derived class overrides. This separates the interface from the implmentation.
Check out the design pattern called Template Method for more information.