title: SFINAE(enable_if) on template arguments without variable specifier
body: <p>This is the code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;type_traits&gt;
  
  
  template &lt;class T&gt;
  typename std::enable_if&lt;std::is_integral&lt;T&gt;::value,bool&gt;::type
    is_odd (T i) {return bool(i%2);}
  
  // 2. the second template argument is only valid if T is an integral type:
  template &lt; class T,
             class = typename std::enable_if&lt;std::is_integral&lt;T&gt;::value&gt;::type&gt;
  bool is_even (T i) {return !bool(i%2);}
  
  
  int main() {
  
    short int i = 1;    // code does not compile if type of i is not integral
  
    std::cout &lt;&lt; std::boolalpha;
    std::cout &lt;&lt; "i is odd: " &lt;&lt; is_odd(i) &lt;&lt; std::endl;
    std::cout &lt;&lt; "i is even: " &lt;&lt; is_even(i) &lt;&lt; std::endl;
  
    return 0;
  }
  </code></pre>
  
  <p>I am trying to learn proper usage of <code>enable_if</code>, i understand if it's used as a return type specifier is that: the compiler will ignore the code. Meaning, the function won't be in the binary file.</p>
  
  <p>I am somehow confused if it's used in a template argument. Based from the code above, it says there that <code>the second template argument is only valid if T is an integral type</code> But i am confused what is  the purpose of that second argument?</p>
  
  <p>I removed it and changed it to:</p>
  
  <pre><code>template &lt; class T&gt;
  bool is_even (T i) {return !bool(i%2);}
  </code></pre>
  
  <p>and it still works fine. Can someone clarify me what's the real purpose of it? There's no variable specifier on it as well.</p>
  
  <p>Or maybe it only serves as a checker if ill do something like </p>
  
  <pre><code>template &lt; class T,
             class B= typename std::enable_if&lt;std::is_integral&lt;T&gt;::value&gt;::type&gt;
  </code></pre>
  
  <p>Allowing me to access B on my code(can be true or false) ?</p>