Consider a program that has a class Foo
containing a function Foo::fn
declared like this:
virtual void fn();
and a subclass of Foo
called Bar
. Will declaring Bar::fn
like this:
virtual void fn() override final;
cause calls to fn
in Bar
or subclasses of Bar
to be any more efficient, or will it just keep subclasses of Bar
from overriding fn
? If calls are made more efficient using final
, what is the simplest, most efficient method to define Bar::fn
such that its functionality is exactly that of Foo::fn
?