Destructor

What is a protected abstract virtual base pure virtual private destructor?
BaluVasudevAsked:
Who is Participating?
 
customizeConnect With a Mentor Commented:
It is a pure virtual private destructor that is inherited from a protected abstract virtual base. In other words, a destructor function that can only be called by members or friends of the class (private), and is assigned a 0 (pure virtual) in the base class (abstract base) that declares it, and will be defined later / overriden in a derived class that shares the multiply-inherited base (virtual base) in a protected way.
class y : virtual protected x
{

private:
~y() = 0;

};


class z : protected y { };
In this instance, ~y() is a protected abstract virtual base pure virtual private destructor of z.

http://blog.360.yahoo.com/blog-1ViKHp06aKQOW02wZ.Cpozw-?cq=1&p=160
0
 
rajeev_devinCommented:
>> What is a protected abstract virtual base pure virtual private destructor?
I don't know what you mean ;-)
0
 
jhshuklaCommented:
if i am not wrong, aren't virtual destructors in base classes required to be protected or public? how else can a derived object cease to exist? as far as i know, after the derived destructor executes, the base destructor is called and if it is private then god help you get out of the mess.
0
 
rajeev_devinCommented:
>> if i am not wrong, aren't virtual destructors in base classes required to be protected or public?
I totally agree with you :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.