title: C++ type qualifier problem
body: <p>As part of my Computer Software Development degree, one of my labs consists of creating a calculator class template and a fraction class.</p>
  
  <p>The problem is with my fraction class. My task is now to overload the plus operator to allow two fractions to be added together.</p>
  
  <p>Fraction.cpp:</p>
  
  <pre><code>#include "Fraction.h"
  
  const Fraction Fraction::operator+ (const Fraction &amp;rhs) const
  {
      return Fraction(_num * rhs.GetDen() + (rhs.GetNum() * _den), _den * rhs.GetDen());
  }
  </code></pre>
  
  <p>Fraction.h</p>
  
  <pre><code>#pragma once
  
  class Fraction
  {
      public:
          Fraction(const int &amp;num, const int &amp;den) : _num(num), _den(den) {}
          ~Fraction(void) {}
          const int GetNum(void) { return _num; }
          const int GetDen(void) { return _den; }
          const Fraction operator+ (const Fraction &amp;rhs) const;
  
      private:
          const int _num, _den;
  };
  </code></pre>
  
  <p>Visual Studio complains that my fraction accessors cannot 'convert this pointer from const fraction to fraction &amp;'. I'm completely baffled.</p>