When an operator is overloaded ? Does it lose any of its original functionality?

Subject Object Oriented Programming
NU Year Set: 5.(d) Marks: 4 Year: 2009

Operator overloading is a technique by which operators used in a programming language are implemented in user-defined types with customized logic that is based on the types of arguments passed. 

Operator overloading facilitates the specification of user-defined implementation for operations wherein one or both operands are of a user-defined class or structure type. This helps user-defined types to behave much like the fundamental primitive data types. Operator overloading is helpful in cases where the operators used for certain types provide semantics related to the domain context and syntactic support as found in the programming language. It is used for syntactical convenience, readability, and maintainability. 

 

Login to post your comment.