title: how and when to use constructor function templates?
body: <p>I'm confused about the sentence below,I understand the example they used for conversion member function but not understand the constructor member function templates occasions<a href="https://stackoverflow.com/questions/16922023/is-there-any-way-to-provide-an-explicit-template-argument-list-for-constructor-f/16922369?noredirect=1#16922369">,helpful example given by Mankarse</a>.</p>
  
  <blockquote>
    <p>Because the explicit template argument list follows the function template name,
    and because conversion member function templates and constructor member function templates are called
    without using a function name, <strong>there is no way to provide an explicit template argument list for these
    function templates.</strong>  --14.5.2.5 N3242</p>
  </blockquote>
  
  <pre><code>struct A {
      template &lt;class T&gt; operator T*();
  };
  template &lt;class T&gt; A::operator T*(){ return 0; }
  template &lt;&gt; A::operator char*(){ return 0; } // specialization
  template A::operator void*(); // explicit instantiation
  
  int main() 
  {
     A a;
     int *ip;
     ip = a.operator int*(); // explicit call to template operator
     // A::operator int*()
  }
  </code></pre>
  
  <hr>
  
  <blockquote>
    <p>The template-arguments for a member function of a class template are determined by the template-arguments
    of the type of the object for which the member function is called.  --14.5.1.1.2 N3242</p>
  </blockquote>
  
  <p><strong>So I need to deduct the template-argument by myself or use a wrapper.</strong><br>
  example given by libstdc++ when reading standard library:</p>
  
  <pre><code>template&lt;typename _Container&gt;
  class back_insert_iterator
  : public iterator&lt;output_iterator_tag, void, void, void, void&gt;
  {
     protected:
        _Container* container;
     public:
         explicit
         back_insert_iterator(_Container&amp; __x) : container(&amp;__x) { }
  }
  /*
   *it use a wrapper :
   */
  template&lt;typename _Container&gt;
  inline back_insert_iterator&lt;_Container&gt;
  back_inserter(_Container&amp; __x)
  { return back_insert_iterator&lt;_Container&gt;(__x); }
  </code></pre>