title: inconsistent deduction for auto
body: <p>Can someone explain to me why the following code gives an error?</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  template &lt;typename aa, typename bb&gt;
  auto minimum(aa a, bb b)
  {
          if (a &lt; b) return a;
          else return b;
  }
  
  int main()
  {
      cout &lt;&lt; minimum(7, 5.1);
  }
  </code></pre>
  
  <blockquote>
    <p>inconsistent deduction for 'auto': 'int' and then 'double'</p>
  </blockquote>
  
  <p>Why does this code work without error?</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  template &lt;typename aa, typename bb&gt;
  auto minimum(aa a, bb b)
  {
       return a &lt; b ? a : b;    
  }
  
  int main()
  {
      cout &lt;&lt; minimum(7, 5.1);
  }
  </code></pre>