Skip to main content
you mixed up 'operator' and 'operand'.
Source Link
user14641
user14641

You could think about isit as a kind of function call:

(operator operand1 operand2 ...) 

There is nothing very special about it. If you overload operators in C++ (and many other languages that allow it) you often have to define this kind of function exactly that way:

MyClass operator+(MyClass const& x, MyClass const& y); 

You could think about is as a kind of function call:

(operator operand1 operand2 ...) 

There is nothing very special about it. If you overload operators in C++ (and many other languages that allow it) you often have to define this kind of function exactly that way:

MyClass operator+(MyClass const& x, MyClass const& y); 

You could think about it as a kind of function call:

(operator operand1 operand2 ...) 

There is nothing very special about it. If you overload operators in C++ (and many other languages that allow it) you often have to define this kind of function exactly that way:

MyClass operator+(MyClass const& x, MyClass const& y); 

You could think about is as a kind of function call:

what_to_do(operator operatorsoperand1 operand2 ...) 

There is nothing very special about it. If you overload operators in C++ (and many other languages that allow it) you often have to define this kind of function exactly that way:

MyClass operator+(MyClass const& x, MyClass const& y); 

You could think about is as a kind of function call:

what_to_do operators 

There is nothing very special about it. If you overload operators in C++ (and many other languages that allow it) you often have to define this kind of function exactly that way:

MyClass operator+(MyClass const& x, MyClass const& y); 

You could think about is as a kind of function call:

(operator operand1 operand2 ...) 

There is nothing very special about it. If you overload operators in C++ (and many other languages that allow it) you often have to define this kind of function exactly that way:

MyClass operator+(MyClass const& x, MyClass const& y); 
Source Link
thorsten müller
  • 12.1k
  • 4
  • 51
  • 54

You could think about is as a kind of function call:

what_to_do operators 

There is nothing very special about it. If you overload operators in C++ (and many other languages that allow it) you often have to define this kind of function exactly that way:

MyClass operator+(MyClass const& x, MyClass const& y);