Show: Object Pascal C++
Display Preferences

operator

From Appmethod Topics
Jump to: navigation, search

Go Up to Keywords, Alphabetical Listing Index


Category

Operators, C++ Specific Keywords

Syntax

operator <operator symbol>( <parameters> )
{
<statements>;
}

Description

Use the operator keyword to define a new (overloaded) action of the given operator. When the operator is overloaded as a member function, only one argument is allowed, as *this is implicitly the first argument.

When you overload an operator as a friend, you can specify two arguments.

See Also

Personal tools
In other languages