|
Boost : |
Subject: Re: [boost] [type_traits] is_constructible, ... when decltype is supported?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-06-07 11:06:30
AMDG
On 06/07/2011 03:40 AM, John Maddock 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(...);
>>
>> 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.
>
> 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 ;-)
>
That's because decltype is only incidental
to the implementation. The important thing
is BOOST_NO_SFINAE_EXPR.
In Christ,
Steven Watanabe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk