
7 Jun
2011
7 Jun
'11
3:02 p.m.
On 05/06/2011 22:32, Vicente Botet wrote:
We can use it as the return type of the test function. FOr example to test if T can be constructed with two parameters A1, A2
decltype((T(declval<A1>(),declval<A2>()), true_type())) test(int); false_type test(...);
You realize you can do the same thing with sizeof in C++03, when BOOST_NO_SFINAE_EXPR is not defined? Also you shouldn't use decltype directly in the return type if you want portability, it caused mangling problems with some GCC versions. Attached is a C++03-compatible version.