When a derived class inherits from its base class virtually, does the destructor of the base class still have to be virtual? How about if the base class is made to not have any objects of its own? This is for something like the diamond problem.
class Parent{
protected:
Parent(){}
/*virtual*/ ~Parent(){}
public:
//Maybe some variables and functions
};
class Gen_A: virtualpublic Parent{
protected:
Gen_A(){}
/*virtual*/ ~Gen_A(){}
public:
//More members
};
class Gen_B: virtualpublic Parent{
protected:
Gen_B(){}
/*virtual*/ ~Gen_A(){}
public:
//Even more members
};
class Final: public Gen_A, public Gen_B{
protected:
//variables maybe
public:
Final(){}
~Final(){}
//Whatever member functions
};
If you're having a diamond in your hierarchy, it means that you have 95% to have done something wrong with said hierarchy.
You should make it virtual to avoid possible problems in future. What if you need to adapt your classes and in one moment base class becomes avaliable? What if somebody who will support this code will need of quick fix, made constructor/destructor public and after that face several different hard-to-find errors because of that?
NEVER assume that "this will never change". It leads to disasters in the future.