"override" Keyword
The override
keyword can be placed after the arguments of a member function, e.g.
class Test
{
public void func() override { }
};
It indicates that a class function overwrites a function of a base class. If this is not the case, the program is incorrect (syntax error).
A member function can therefore be used without specifier, with final
, override
, final override
or override
final
.
A function marked as final
/override
must not be static.
If a function is marked as override
, all overriding functions in the class must be marked so as well for consistency reasons. It is not a syntax error not to do this,
but it will cause a warning during the integrity check.
final
and override
are keywords in Ctrl++. They cannot be used as
identifiers, e.g. as names of variables or functions, etc.