title: How to implicitly cast all arguments of a template function to the highest resolution type?
body: <p>In a project I'm working on I have a templated function similar to this where all of the arguments should be of type T</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  template&lt;typename T&gt; bool aWithinBOfC(T a, T b, T c)
  {
      return std::abs(a - c) &lt; b;
  }
  </code></pre>
  
  <p>the issue I'm having is it won't compile if all of the arguments are not of the same type but it seems reasonable that it should implicitly cast similar types to the one with the highest resolution before evaluation. Is there any way to get a call like this to be valid?</p>
  
  <pre><code>int main()
  {
      double a{1.2};
      double b{1.4};
      float c{0.1f};
  
      std::cout &lt;&lt; aWithinBOfC(a, b, c) &lt;&lt; std::endl;
  }
  </code></pre>