Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-10 08:40:25


"John Maddock" <john_at_[hidden]> writes:

>> I'm fixing the compilation problems with VC7.1 for the recently accepted
>> Numeric Conversions Library and found the following:
>>
>> (1)
>> I erroneously used a construct of the follwing form:
>>
>> typedef typename boost::is_same<T,S>::type is_trivial ;
>>
>> typedef typename boost::mpl::if_<is_trivial,ABC,DEF>::type type ;
>>
>> The error is in the "::type" after is_same<>; mpl::if_ can take the traits
>> as is, without the "::type"
>>
>> However, that code did pass many of the other compilers, so that "::type"
>> does exist in some cases.
>>
>> Is this a bug in the VC7.1 version of "is_same"? That is, was it intended to
>> have "::type"?
>
> Not yet, the ::type member is not part of the documented interface, but we
> do need to deal with that sometime.

John,

I don't know what you mean here, but when Aleksey reworked all the
type traits for MPL compatibility before 1.30.0 they all got a ::type,
is_same included. Why Fernando isn't seeing it, I don't know, but all
specializations of is_same are derived from an mpl::bool_<...>
specialization, each of whose nested ::type is the bool_<...>
specialization itself.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk