title: error: C2440 'return': cannot convert from 'int' to T
body: <p>I get this error both on VS2017 and g++, compiling with C++17 compliance. Can anyone explain?</p>
  <pre><code>template&lt;typename T&gt;
  T doit(T&amp;&amp; arg) {
      int result{ arg * 2 };
      return result; // works
      // return arg; // works
      // return arg*2; // error: C2440 'return': cannot convert from 'int' to T
  }
  int main() {
      int i {42};
      cout &lt;&lt; doit(i) &lt;&lt; endl;
      return 0;
  }
  </code></pre>