Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-05-26 11:25:22


David Abrahams wrote:
> Howard Hinnant <hinnant_at_[hidden]> writes:
>
>>
>> I haven't dug into boost::is_pointer, but I'm guessing it involves a
>> tentative binding to an ellipsis:
>>
>> template <class U> static two test(...);
>>
>> 5.2.2p7 says that binding a non-POD class type to an ellipsis has
>> undefined behavior. CodeWarrior's behavior in this context is to try
>> to pass the type by value by using the type's copy constructor, which
>> in this case is private, and thus triggers the access error.
>>
>> Metrowerks::is_pointer has a much simpler implementation.
>
> We should probably be forwarding to the metrowerks implementation on
> 9.4, where it's available. Failing that we can check is_class first
> and avoid the rest of the check in that case.

I must be missing something. The trivial implementation of is_pointer:

template<class T> struct is_pointer: mpl::false_ {};
template<class T> struct is_pointer<T*>: mpl::true_ {};

should work on everything except MSVC 6/7, right? So why isn't it being
used?


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