title: Question on overloading operator+
body: <p>Consider the following code:</p>
  
  <pre><code>
  class A
  {
  public:
      A& operator=( const A& );
      const A& operator+( const A& );
      const A& operator+( int m );
  };
  
  int main()
  {
      A a;
      a = ( a + a ) + 5;   // error: binary '+' : no operator found which takes a left-hand operand of type 'const A'
  }
  </code></pre>
  
  <p>Can anyone explain why the above is returned as an error?</p>
  
  <p>"<code>( a + a )</code>" calls "<code>const A&amp; operator+( const A&amp; )</code>" and returns a constant reference which is then passed to "<code>const A&amp; operator+( int m )</code>" if I'm not mistaken.</p>
  
  <p>How can one fix the above error (without creating a global binary operator+ or a constructor that accepts an int) such that the statement inside <code>main()</code> is allowed?</p>