title: assigning to rvalue: why does this compile?
body: <p>In the following example:</p>
  
  <pre><code>class A {
    private: double content;
  
    public:
    A():content(0) {}
  
    A operator+(const A&amp; other) {     
      content += other.content;
      return *this;
    }
  
   void operator=(const A&amp; other) {
         content = other.content;
    }
  
  };
  </code></pre>
  
  <p><code>A</code> is a simple wrapper for a double for which the <code>+</code> and <code>=</code> operators have been overloaded. In the following use:</p>
  
  <pre><code> int main(int argc, char *argv[]) {
      A a, b, c;
      (a+b) = c ; // Why is this operation legal?
  }
  </code></pre>
  
  <p><strong>Why does <code>(a+b) = c</code> compile?</strong> I would like to know why this statement is legal, because the result of <code>(a+b)</code> must be an <code>rvalue</code>. I am not returning a reference from <code>operator+</code>.</p>