cpp/language/override

Specifies that a overrides another virtual function.

Syntax
The identifier, if used, appears immediately after the in the syntax of a member function declaration or a member function definition inside a class definition.

@1@ In a member function declaration, may appear in  immediately after the declarator, and before the, if used. @2@ In a member function definition inside a class definition, may appear in  immediately after the declarator and just before.

In both cases,, if used, is either or , or  or.

Explanation
In a member function declaration or definition, specifier ensures that the function is virtual and is overriding a virtual function from a base class. The program is ill-formed (a compile-time error is generated) if this is not true.

is an identifier with a special meaning when used after member function declarators: it's not a reserved keyword otherwise.