title: Why aren't class template constructor arguments automatically determined?
body: <p>Consider the following class:</p>
  
  <pre><code>template&lt;typename T1, typename T2&gt;
  class Pair
  {
       public:
           T1 First;
           T2 Second;
           Pair(const T1 &amp;First, const T2 &amp;Second) : First(First), Second(Second) { }
  }
  </code></pre>
  
  <p>The following is not allowed in c++:</p>
  
  <pre><code>auto p = Pair(10, 10);
  </code></pre>
  
  <p>Why isn't that allowed? the types can be completely determined from the constructor call.<br>
  I know there are workaround for that like:</p>
  
  <pre><code>template&lt;typename T1, typename T2&gt;
  Pair&lt;T1, T2&gt; MakePair(const T1 &amp;First, const T2 &amp;Second)
  {
      return Pair&lt;T1, T2&gt;(First, Second);
  }
  </code></pre>
  
  <p>But why is that needed? Why doesn't the compiler just determine the type from the arguments just like it does from function template? You might say its because the standard doesn't allow it, so why doesn't the standard allow it?</p>
  
  <p>Edit:<br>
  For those who say this is an example why this shouldn't be allowed:</p>
  
  <pre><code>template&lt;typename T1, typename T2&gt;
  class Pair
  {
       public:
           T1 First;
           T2 Second;
           Pair(const T1 &amp;First, const T2 &amp;Second) : First(First), Second(Second) { }
           Pair(const T2 &amp;Second, const T1 &amp;First) : First(First), Second(Second) { }
  };
  
  auto p = Pair(10,1.0);
  </code></pre>
  
  <p>I can do exactly this with function templates overloading:</p>
  
  <pre><code>template&lt;typename T1, typename T2&gt;
  Pair&lt;T1, T2&gt; MakePair(const T1 &amp;First, const T2 &amp;Second)
  {
      return Pair&lt;T1, T2&gt;(First, Second);
  }
  template&lt;typename T1, typename T2&gt;
  Pair&lt;T1, T2&gt; MakePair(const T2 &amp;Second, const T1 &amp;First)
  {
      return Pair&lt;T1, T2&gt;(First, Second);
  }
  </code></pre>
  
  <p>Why is this allowed for functions but not for classes?</p>