• Operator listed in below tables only can be overloaded.
  • New Operator can not be created. Like taking inspiration from ++ and — operator we can not create ** or +++ operators.
  • Some of the operators can not be overloaded. These are listed in table 1 below.
  • Some of the operators cab be overloaded using non-static member functions. These operators can not be overloaded using friend function.
  • When overloading unary operator using member function no argument is required. If we use friend function we need to pass class object as reference in argument.
  • When overloading Binary operator using member function takes one argument is required. If we use friend function we need to pass class object as reference in argument two times
  • We can’t change the predefined meaning of the operators. .
Rules for Operator Overloading in CPP

Leave a Reply

Your email address will not be published. Required fields are marked *