title: warning C4244: 'argument' : conversion from 'double' to 'const int', possible loss of data
body: <p>I'm defining the '*' operator to work with a 'NumericArray' class template. The code is as following:</p>
  
  <pre><code>template &lt;class T&gt;
  NumericArray&lt;T&gt; NumericArray&lt;T&gt;::operator * (const T&amp; factor) const
  {
      NumericArray&lt;T&gt; newArray(Size());
      for (int i = 0; i &lt; Size(); i++)
          newArray[i] = factor * GetE(i);
      return newArray;
  }
  </code></pre>
  
  <p>when I try to use a 'NumericArray' of type 'int' (NumericArray) with the '*' operator when the 'factor' argument is a double:</p>
  
  <pre><code>intArray1 = intArray1*2.5;
  </code></pre>
  
  <p>I get the following compiler warning:</p>
  
  <pre><code>warning C4244: 'argument' : conversion from 'double' to 'const int', possible loss of data
  </code></pre>
  
  <p>and the 'factor' arg is truncated from 2.5 to 2 (an int) before it is multiplied against elements of the 'NumericArray' object. Is there a way to prevent this from happening? I thought in C++ it was a simple matter of default protocol where int*double = double. Am I wrong? If not, why doesn't that apply in this case? </p>