Below code demonstrate the operator overloading feature of C++. We are overloading unary operator ++ and — on Distance class and implementing custom logic for the increment and decrement operation. Operator function is member function of Distance class. This post
Overloading Unary Operator Using Member Functions (-,++ and –) in C++ Distance Class
