RAD Studio |  |

Overloading The Function Call Operator ( )
See Also
Collapse All

Syntax

Copy Code

    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.

See Also

Example Of Overloading Operators

Overloaded Operators And Inheritance

Overloading Binary Operators

Overloading Operator Functions

Overloading The Assignment Operator =

Overloading The Class Member Access Operators ->

Overloading The Subscript Operator []

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