devxlogo

Making a Class Final

Making a Class Final

The following code explains how to make a class that is final, meaning that it cannot be derived further.

 class FinalBase{    FinalBase() {}    friend class Final;};class Final : private virtual FinalBase{};

devx-admin

Share the Post: