title: `std::enable_if` SFINAE custom type via template parameter?
body: <p><strong>First question</strong>: let's say that I have a custom <code>struct</code> like this one:</p>
  
  <pre><code>struct Var {};   
  
  struct is_var_type: std::integral_constant&lt;bool, std::is_same&lt;Var, typename std::remove_cv&lt;T&gt;::type&gt;::value&gt; {};
  </code></pre>
  
  <p>After this, I want to have some custom type via a template parameter SFINAE using <code>std::enable_if</code>, however I couldn't figure it out. I could only do this:</p>
  
  <pre><code>template&lt;typename T&gt; 
  void variant(T a)
  { 
      if (is_var_type&lt;Var&gt;::value){
          std::cout &lt;&lt; " " &lt;&lt; true;
      }
      else {
          std::cout &lt;&lt; " " &lt;&lt; false;  
      }
  }
  </code></pre>
  
  <p>I want to make something like this one, but <code>std::is_integral</code> has already been defined. How is a custom one made?</p>
  
  <pre><code>template&lt;class T, typename std::enable_if&lt;std::is_integral&lt;T&gt;::value&gt;::type* = nullptr&gt; // I couldn't figure out how to make custom integral_constant via template parameter 
  T foo3(T t) // note, function signature is unmodified
  {
      return t; //so this type should be an int, but I want to make sure that this type T is is_var_type struct, is this possible?
  }
  </code></pre>
  
  <p><strong>Second question</strong>: is this way possible if we add some container type like this? </p>
  
  <pre><code>struct Var {};
  struct ListVar: public std::list&lt;Var&gt;
  struct is_var_type: std::integral_constant&lt;bool, std::is_same&lt;ListVar, typename std::remove_cv&lt;T&gt;::type&gt;::value&gt; {};
  </code></pre>
  
  <p>– but I got an even more confusing compile time error, something like cannot deduce multiple type in <code>gcc 4.9</code>.</p>