RAD Studio
ContentsIndex
PreviousUpNext
Overloading The Function Call Operator ( )

Syntax

postfix-expression ( <expression-list> )

Description 

In its ordinary use as a function call, the postfix-expression must be a function name, or a pointer or reference to a function. When the postfix-expression is used to make a member function call, postfix-expression must be a class member function name or a pointer-to-member expression used to select a class member function. In either case, the postfix-expression is followed by the optional expression-list. 

A call X(arg1, arg2), where X is an object class X, is interpreted as X.operator()(arg1, arg2). 

The function call operator, operator()(), can only be overloaded as a nonstatic member function.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!