The syntax for sealing a virtual function has changed from Managed Extensions for C++ to Visual C++ 2005.

The __sealed keyword is used in Managed Extensions to modify either a reference type, disallowing subsequent derivation from it (see Declaration of a Managed Class Type), or to modify a virtual function, disallowing subsequent overriding of the method in a derived class. For example:

In this example, derived::f() overrides the base::f() instance based on the exact match of the function prototype. The __sealed keyword indicates that a subsequent class inherited from the derived class cannot provide an override of derived::f().

In the new syntax, sealed is placed after the signature rather than being allowed to appear anywhere before the actual function prototype, as was previously allowed. In addition, the use of sealed requires an explicit use of the virtual keyword as well. That is, the correct translation of derived, above, is as follows:

The absence of the virtual keyword in this instance results in an error. In the new syntax, the contextual keyword abstract can be used in place of the =0 to indicate a pure virtual function. This was not supported within Managed Extensions. For example: