operator overloading - krishnaramb/cplusplus GitHub Wiki

Important points to remember about operator overloading

  • you can't invent operator (e.g. ,,,)
  • you can't define operator (e.g. << on float)
  • you can overload an operator (e.g. << on ostream)
  • can't change precedence
  • can't change associativity
  • can't change arity
  • can change r-value/l-value nature of the args and the return