Substitution failure is not an error: Difference between revisions

Content deleted Content added
Correct an example with std::is_detected. decltype can be applied only to variables, and not types. Here foo::foobar is a type, so using decltype is incorrect.
No edit summary
Line 63:
When <code>T</code> has the nested type <code>foobar</code> defined, the instantiation of the first <code>test</code> works and the null pointer constant is successfully passed. (And the resulting type of the expression is <code>yes</code>.) If it does not work, the only available function is the second <code>test</code>, and the resulting type of the expression is <code>no</code>. (An ellipsis is used not only because it will accept any argument, but also because its conversion rank is lowest, so a call to the first function will be preferred if it is possible; this removes ambiguity.)
 
== C++11 simplification ==
In C++11, the above code could be simplified to: