previous | start | next

Operator Overloading (Syntax 17.1 : Overloading Operator Definition)

Syntax 17.1 : Overloading Operator Definition

return_type operatoroperator_symbol(parameters)
{   statements
}
Example:
int operator-(Time a, Time b)
{
   return a.seconds_from(b)
}
Purpose: Supply the implementation of an overloaded operator.


previous | start | next