title: Why does this constructor overload resolve incorrectly?
body: <p>This is my (stripped) class and instantiation of one object:</p>
  
  <pre><code>template &lt;typename T, typename Allocator = std::allocator&lt;T&gt; &gt;
  class Carray {
      typedef typename Allocator::size_type size_type;
  
      // ...
  
      explicit Carray(size_type n, const T&amp; value, const Allocator&amp; alloc = Allocator()) {
          // ...
      }
  
      template&lt;typename InputIterator&gt;
      Carray(InputIterator first, InputIterator last, const Allocator&amp; alloc = Allocator()) {
          // ...
      }
  
      // ...
  }
  
  Carray&lt;int&gt; array(5, 10);
  </code></pre>
  
  <p>I would expect this to call the <code>Carray(size_type, const T&amp;, const Allocator&amp;)</code> constructor, but it doesn't. Apparantly this resolutes to <code>template&lt;typename InputIterator&gt; Carray(InputIterator, InputIterator, const Allocator&amp;)</code>.</p>
  
  <p>What should I change to make this work as intended? I find it weird also, because a call to <code>std::vector&lt;int&gt; v(5, 10)</code> works perfectly fine. And if I look at the definition of the constructors in my GCC's implementation I find this (I renamed some compiler-implementation names, like  <code>__n</code>):</p>
  
  <pre><code>template&lt;typename T, typename A = std::allocator&lt;T&gt; &gt;
  class vector {
      typedef size_t size_type;
      typedef T value_type;
      typedef A allocator_type;
  
      // ...
  
      explicit vector(size_type n, const value_type&amp; value = value_type(), const allocator_type&amp; a = allocator_type());
  
      template&lt;typename InputIterator&gt;
      vector(InputIterator first, InputIterator last, const allocator_type&amp; a = allocator_type());
  
      // ...
  };
  </code></pre>
  
  <p>which seems to be the same.</p>