A protected abstract virtual base pure virtual private destructor.
This is one of the funny question and very less answered one. It may be a very long sentence. But the code needed for making a protected abstract virtual base pure virtual private destructor is quite simple.
The below code is the one which makes a protected abstract virtual base pure virtual private destructor
class BaseClass // An abstract class
virtual void MakeAbstract() = 0;
// A class derived as an protected abstract virtual base
class AbstractBase : virtual protected BaseClass
// A pure virtual private destructor
virtual ~AbstractBase() = 0;
friend class Derived;
class Derived : protected AbstractBase
int main(int argc, _TCHAR* argv)
// You can definitely make an object of class Derived
In the above program AbstractBase::~AbstractBase() can be called as a protected abstract virtual base pure virtual private destructor. Let us see how it can be called so.
1. The class AbstractBase is derived as "virtual protected" from an "abstract base" class. So we can call class AbstractBase as a "protected abstract virtual base".
2. Now let us check the destructor of class AbstractBase. It is made as a "pure virtual private" one. So we can call it as a "pure virtual private destructor".
3. Now combining both, we can call the destructor of AbstractBase as "protected abstract virtual base pure virtual private destructor"
This question can measure the knowledge in C++. Practically it wont have much of a use in implementation point of view. This question was made to prove that C++ is too complex and weird. But when we see the code for such a big definition it serves in the opposite way. Its quite easy to write long sentences in very few line of codes.