title: Why is sfinae on if constexpr not allowed?
body: <p>The detection idiom works as follows</p>
  
  <pre><code>template&lt;typename T, typename = void&gt;
  struct has_foo {static constexpr bool value = false;};
  template&lt;typename T&gt;
  struct has_foo&lt;T, std::void_t&lt;decltype(&amp;T::foo)&gt;&gt; {static constexpr bool value = true;};
  template&lt;typename T&gt;
  constexpr bool has_foo_v = has_foo&lt;T&gt;::value;
  </code></pre>
  
  <p>And then we can detect the presence of <code>foo</code> in any type <code>T</code>.</p>
  
  <pre><code>if constexpr(has_foo_v&lt;decltype(var)&gt;)
      var.foo();
  </code></pre>
  
  <p>My problem is, that is quite a lot to type (read: want to smash my keyboard a lot to type), and I wondered if the following is possible</p>
  
  <pre><code>if constexpr(std::void_t&lt;decltype(&amp;decltype(var)::foo)&gt;(), true)
      var.foo();
  </code></pre>
  
  <p>It is not.</p>
  
  <p>Is there a reason behind this?<br>
  More specifically, what trade-offs will have to be made if this were allowed?</p>