
7 Jun
2011
7 Jun
'11
10:40 a.m.
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(...);
Unfortunately, Boost.TypeOf can not be used for the failing checks, as compilation fails.
I have committed them in the sandbox under conversion/boost/conversion/type_traits.
Cool! I think it would be good to have these in type_traits, currently though it seems that only GCC will compile the code - VC10 fails irrespective of whether BOOST_NO_DECLTYPE is set or not :-( I don't suppose there's any chance of a fix/workaround for this? I couldn't see one from a quick hack around, but I thought I'd ask anyway ;-) Cheers, John.