title: Select constructor through SFINAE in template arguments
body: <p>I'm trying to select a constructor through SFINAE as following:</p>
  
  <pre><code>template&lt;typename T&gt;
  class MyClass
  {
  public:
      template&lt;typename C, typename = std::enable_if_t&lt;std::is_class&lt;C&gt;::value&gt;&gt;
      MyClass(C) { }
  
      template&lt;typename C, typename = std::enable_if_t&lt;std::is_pointer&lt;C&gt;::value&gt;&gt;
      MyClass(C) { }
  };
  </code></pre>
  
  <p>but the compiler complains with following error:</p>
  
  <blockquote>
    <p>error C2535: 'MyClass::MyClass(C)': member function already defined or declared</p>
  </blockquote>
  
  <p>without even instantiating the constructor.</p>
  
  <p>I worked out a working but ugly solution which i don't want to use because of the extra unused parameter:</p>
  
  <pre><code>template&lt;typename T&gt;
  class MyWorkingClass
  {
  public:
      template&lt;typename C&gt;
      MyWorkingClass(C, std::enable_if_t&lt;std::is_class&lt;C&gt;::value&gt;* = nullptr) { }
  
      template&lt;typename C&gt;
      MyWorkingClass(C, std::enable_if_t&lt;std::is_pointer&lt;C&gt;::value&gt;* = nullptr) { }
  };
  </code></pre>
  
  <p>A short usage example is given here:</p>
  
  <pre><code>void* ptr = nullptr;
  MyClass&lt;int&gt; mc1(ptr);
  
  std::vector&lt;int&gt; vec;
  MyClass&lt;int&gt; mc2(vec);
  
  // Shall raise an error
  // MyClass&lt;int&gt; mc2(0);
  </code></pre>
  
  <p>The traits <code>std::is_pointer</code> and <code>std::is_class</code> are just an example, the original traits are more complicated.</p>
  
  <p><strong>Is there a way to select the constructor through SFINAE without adding another parameter to the constructor (maybe very close to the first appproach)?</strong> </p>