## 17.4 Overloading Comparison Operators

- E.g., from the `Fraction` class:

  >     bool operator==(const Fraction&amp; left, const Fraction&amp; right)
  >     {
  >        return left.numerator() * right.denominator()
  >           == right.numerator() * left.denominator();
  >     }

  >     bool operator<(const Fraction& left, const Fraction& right)
  >     {
  >        return left.numerator() * right.denominator()
  >           < right.numerator() * left.denominator();
  >     }

prev |top |next