title: Why std::void_t is required to detect ill-formed types in SFINAE context?
body: <p>I have <code>is_callable</code> trait as below:</p>
  <pre class="lang-cpp prettyprint-override"><code>template&lt;class T, class = void&gt;
  struct is_callable: std::false_type {};
  
  template&lt;class T&gt;
  struct is_callable&lt;T, std::void_t&lt;decltype(&amp;T::operator())&gt;&gt;: std::true_type {};  // (A)
  </code></pre>
  <p>There I have to wrap <code>decltype(&amp;T::operator())</code> with <code>std::void_t</code> rather than use just the <code>decltype</code> itself like this:</p>
  <pre class="lang-cpp prettyprint-override"><code>template&lt;class T&gt;
  struct is_callable&lt;T, decltype(&amp;T::operator())&gt;: std::true_type {};  // (B)
  </code></pre>
  <p>If I use just the <code>decltype</code> itself (B) then I got no compilation error thus I assume that <code>decltype</code> is still in SFINAE context but the detection does not work - the trait value is always false. Can someone explain how exactly <code>void_t</code> helps here.</p>