title: Achieving an SFINAE-like effect in an if-else block
body: <p>I would like to be able to write something like</p>
  
  <pre><code>template &lt;typename T&gt; void foo() {
      // ...
      if (is_nice&lt;T&gt;::value) {
          bar_which_is_defined_only_for_nice_types&lt;T&gt;();
      }
  }
  </code></pre>
  
  <p>However, when I try to compile this (g++ 4.9.3, no optimization) I get a complaint about <code>bar_which_is_defined_only_for_nice_types</code>. How can I achieve the desired effect without resorting to 2 definitions of <code>foo()</code>?</p>