1.

Specify Some Guidelines That Should Be Followed While Overloading Operators?

Answer»

Following are some of the guidelines that should be followed while OVERLOADING operators:

  1.  Subscript bracket operators should be USED for overloading when there is a need of fetching DATA from the container class.
  2. Arithmetic operators should be used for providing the numerical CALCULATION to the operators.
  3. Comma operator overloading should be used less often as the ordering properties of this operator vary before and after overloading. This variation in the ordering properties confuses the users of this operator.
  4. The priority order in which operators are EXECUTED cannot be modified by overloading the operators.
  5. The overloaded operators must follow the syntax of the language in which they are used.

Following are some of the guidelines that should be followed while overloading operators:



Discussion

No Comment Found