
Mathias Gaunard-2 wrote:
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.
Hi, glad to see that a C++03 version works. Unfortunately it seems that only gcc since 4.4 supports this. Anyway I agree that your solution should be more portable. Best, Vicente -- View this message in context: http://boost.2283326.n4.nabble.com/type-traits-is-constructible-when-decltyp... Sent from the Boost - Dev mailing list archive at Nabble.com.