Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-01-27 21:02:25


----- Original Message -----
From: "John Maddock" <John_Maddock_at_[hidden]>

> >I've been digging through the type_traits package to find how various
> >hacks were done to support compilers like MSVC++, and I noticed a
> >simplification that could be made to the library. The is_const struct
> >uses a static member in order to get a pointer of the appropriate type to
> >pass to its helper function. This could be done with a cast of a null
> >pointer instead:
>
> Thanks, however, note that that implementation will not compile if T is a
> reference type...

...and the current implementation won't work if T is void.
I think we could get around this problem at the cost of a little extra
complexity... we can use "poor man's partial specialization" to dispatch to
a different implementation if T is void.

-Dave


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