title: Multiplication operator overloading
body: <p>I am implementing a class Vector and defined the multiplication operator as a <strong>member</strong> of the class as</p>
  
  <pre><code>Vector operator*(const float&amp; s);
  </code></pre>
  
  <p>as far as I understand, this means that the left operand is a <code>Vector</code> and the right operand is a <code>float</code>. So if I try and do something like this</p>
  
  <pre><code>Vector c(1,2,3);
  Vector d = c * 2.0f; // Results in d = (2,4,6)
  </code></pre>
  
  <p>that's ok, however, to my eyes is weird to see first the vector then the scaling factor, so in order to have <code>float * Vector</code> I defined a <strong>non-member</strong> function as</p>
  
  <pre><code>Vector operator*(const float&amp; s, const Vector&amp; v)
  {
      //Invalid operands to binary expression 'const Vector' and 'float'
      return v * s;
  }
  </code></pre>
  
  <p>However I received the error in the comment. I don't know what am I missing or if this is not the way I should declare the operator in order to do the scaling in <code>float * Vector</code> fashion.</p>