Go to the first, previous, next, last section, table of contents.


5.2.2 Function Specifiers

The following is the syntax of function-specifiers.

function-specifier ::= virtual | inline | explicit

The virtual specifier may be used only in declaration of a nonstatic class member function within a class specification (see Section r.7.1.2 of [Stroustrup91]). To specify a pure virtual member function in an abstract class, one should use an initializer of the form =0 (see Section 10.3 of [Ellis-Stroustrup90]). A class with any pure virtual functions is an abstract class. See section 7.10 Abstract Classes for more information about abstract classes.

The inline specifier should only be used when one desires to record an implementation design decision, as it does not usually concern the clients of a C++ function. A C++ function satisfies a specification that does not use inline regardless of whether inline appears in the implementation. However a C++ function satisfies a specification that uses inline only if the function also uses inline, or a sugar for it such as giving the definition of a member function in the class declaration (Section 9.3.2 [Ellis-Stroustrup90]).


Go to the first, previous, next, last section, table of contents.