title: What is "Expression SFINAE"?
body: <p>At <a href="http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx" rel="noreferrer">http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx</a>, the VC++ team officially declare that they have not yet implemented the C++11 core feature "Expression SFINAE". However, The following code examples copied from <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html" rel="noreferrer">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html</a> are accepted by the VC++ compiler.</p>
  
  <p>example 1:</p>
  
  <pre><code>template &lt;int I&gt; struct A {};
  
  char xxx(int);
  char xxx(float);
  
  template &lt;class T&gt; A&lt;sizeof(xxx((T)0))&gt; f(T){}
  
  int main()
  {
      f(1);
  }
  </code></pre>
  
  <p>example 2:</p>
  
  <pre><code>struct X {};
  struct Y 
  {
      Y(X){}
  };
  
  template &lt;class T&gt; auto f(T t1, T t2) -&gt; decltype(t1 + t2); // #1
  X f(Y, Y);  // #2
  
  X x1, x2;
  X x3 = f(x1, x2);  // deduction fails on #1 (cannot add X+X), calls #2
  </code></pre>
  
  <p><strong>My question is: What is "Expression SFINAE"?</strong></p>