/** * Demonstration of operator overloading * CS 2240 * University of Vermont * Egbert Porcupine * 2020-Jul-03 * * This follows the common practice of placing declarations in the header * file and implementations in a corresponding .cpp file */ #ifndef DEMO_FOO_H #define DEMO_FOO_H class Foo { private: int data; public: Foo(int data); friend bool operator < (const Foo& lhs, const Foo& rhs); friend bool operator > (const Foo& lhs, const Foo& rhs); friend bool operator <= (const Foo& lhs, const Foo& rhs); friend bool operator >= (const Foo& lhs, const Foo& rhs); friend bool operator == (const Foo& lhs, const Foo& rhs); friend bool operator != (const Foo& lhs, const Foo& rhs); }; #endif //DEMO_FOO_H