Boost logo

Boost :

From: Herve Bronnimann (hbr_at_[hidden])
Date: 2002-05-17 23:36:09


On Thu, May 16, 2002 at 03:39:48PM -0700, Paul Mensonides wrote:
> If you have a typelist of signed and unsigned integral types, you can
> do this in a generic way like this: ... With this you can write:
> numeric_equiv<T, unsigned>::type
> -or-
> numeric_equiv<T, signed>::type
> --and it isn't machine-specific. Of course, this isn't Boost stuff, but maybe
> the MPL has something like it. :)
> Does this help?
> Paul Mensonides

Interesting! Thanks for the nugget. Actually, yes, it solves a problem
that I had with the partial specialization approach (that on some
machines, short was the same type as int and would produce an error:
make_unsigned<short> specialization already defined... I'm not getting
into details here, not even sure if the standard mandates short
and int to be distinct types---would've thought so though).

Thanks again,

-- 
Hervé

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