title: C++ Operator Overload with Value Reference
body: <p>I'm overloading a vector operator '-' and trying difference reference method. The code that test the operator is </p>
  
  <pre><code>pos-(norm-bias)
  </code></pre>
  
  <p>where pos, norm and bias are all instances of the class Vector. </p>
  
  <p>Constant reference worked:</p>
  
  <pre><code>Vector operator-(const Vector&amp; v) {
  </code></pre>
  
  <p>However, I don't understand why without the 'const' keyword would result in an error: Invalid operands to binary expressions. </p>
  
  <pre><code>Vector operator-(Vector&amp; v) {
  </code></pre>
  
  <p>Furthermore, I don't understand why "const Vector&amp;&amp; v" with rvalue reference failed.</p>
  
  <pre><code>Vector operator-(const Vector&amp;&amp; v) {
  </code></pre>