title: Why Template Function call is ambiguous?
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  template &lt;typename T&gt;
  T max(T x, T y)
  {
      return (x &gt; y) ? x : y;
  }
  int main()
  {
      cout &lt;&lt; max(3, 7) &lt;&lt; std::endl;
      cout &lt;&lt; max(3.0, 7.0) &lt;&lt; std::endl;
      cout &lt;&lt; max(3, 7.0) &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  
  <p>I'm Expecting max's Instance here</p>
  
  <pre><code>cout &lt;&lt; max(3, 7) &lt;&lt; std::endl; // max (int, int)
  cout &lt;&lt; max(3.0, 7.0) &lt;&lt; std::endl; // max (double, double)
  cout &lt;&lt; max(3, 7.0) &lt;&lt; std::endl; // max(int, double)
  </code></pre>
  
  <p>Then what is the problem ? Why I'm getting </p>
  
  <p><code>11 25  [Error] call of overloaded 'max(double, double)' is ambiguous</code></p>