So, I found this quote today, can anyone explain?
\"If you think C++ is not overly complicated, just what is a protected abstract virtual base pure virtual private d
I believe it is a private pure virtual destructor (I think that part is self-explanatory) that is part of an abstract base class, which you've used through protected virtual inheritance. .
class Base
{
private:
virtual ~Base() = 0; /* A */
};
class Derived : protected virtual Base
{
private:
~Derived () {.......} /* B */
};
From the point of view of tag B, the line at tag A is a "protected abstract virtual base pure virtual private destructor",
Each of those three parts has its uses individually. I do not know of a design pattern that requires all three of the above parts, but there's nothing preventing their uses together.
These words seem to make sense but not really.
Also stringing two different things together attributes in an attempt to over complicate things is a sign that author is just trying to confuse people to try and make a point that is not really there.
We should note that each situation is unique and you build your class hierarchy and destructors as required by the situation. Calling the language overcomplicated because it provides facility is silly. Its like saying what is the point of private inheritance. Yes normally you are not going to use it but there will be an occasion when it is nice to have.
Also I don't think of:
protected abstract virtual base pure virtual private destructor and when was the last time you needed one
I think:
Not sure of the original context, but my guess would be someone claiming that C++ is less complicated that a language like Java. Tom's point is that C++ has enough features to it that you can easily make a construct that is VERY complicated.
Basically, he just threw together a bunch of words and stuck them together without realizing they actually refer to different things, or often, the same thing.
protected abstract virtual base
Pretty simple.
class Base { // BASE
virtual something() = 0; // ABSTRACT
};
class Derived : protected virtual Base { // PROTECTED VIRTUAL
};
pure virtual private destructor
Also pretty simple.
class Base { // BASE
private:
virtual ~Base() = 0; // pure virtual, private, destructor
};
class Derived : Base {
};
Of course, pure virtual is the same as abstract.
It's quite clearly complete and total hyperbole written by someone who doesn't have a clue what he's talking about.
Scott Meyers has his answer also:
https://youtu.be/ltCgzYcpFUI?t=7m25s