Way of overloading operator without changing original values?
<p>I'm wondering if you can overload an operator and use it without changing the object's original values.</p>

<p>Edited code example: </p>

<pre><code>class Rational{
public:
   Rational(double n, double d):numerator_(n), denominator_(d){};
   Rational(){}; // default constructor
   double numerator() const { return numerator_; } // accessor
   double denominator() const { return denominator_; } // accessor
private:
    double numerator_;
    double denominator_;
};

const Rational operator+(const Rational&amp; a, const Rational&amp; b)
{
      Rational tmp;
      tmp.denominator_ = (a.denominator() * b.denominator());
      tmp.numerator_ = (a.numerator() * b.denominator());
      tmp.numerator_ += (b.numerator() * a.denominator());
      return tmp;
}
</code></pre>

<p>I made the accessors const methods, but I'm still getting a privacy error for every tmp.denominator_ / numerator_.</p>
