Operator Overloading
Imagine we wanted to add member functions to our class
complex to increment/decrement the real and imaginary parts:
complex(float r = 0.0, float i = 0.0) { real_p=r; imag_p=i; }
// We’re giving these member functions strange names, but
// the reason will soon be clear...
operator++() { real_p += 1.0; imag_p += 1.0; }
operator--() { real_p -= 1.0; imag_p -= 1.0; }