Overloading Operators

  • Ray Lischner


This Exploration continues the study of writing custom types. An important aspect of making a custom type behave seamlessly with built-in types is ensuring that the custom types support all the expected operators—arithmetic types must support arithmetic operators, readable and writable types must support I/O operators, and so on. Fortunately, C++ lets you overload operators in much the same manner as overloading functions.


Rational Number Rational Object Custom Type Custom Operator Arithmetic Operator 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Ray Lischner 2013

Authors and Affiliations

  • Ray Lischner
    • 1
  1. 1.MDUS

Personalised recommendations