"final" Keyword
You can use the keyword final
to specifiy that a class member function cannot be overridden in a derived class or that a class cannot be derived from.
The final
keyword can be placed after a class name for the whole class, e.g.
class FinalClass final
{
};
/* or for a specific member function after the arguments, e.g. */
class Test
{
public void func() final { }
};