Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 1999-12-22 18:54:35


jsiek_at_[hidden] wrote on 12/22/99 6:15 PM
>Looks like that works for both EDG and g++ :)

Thanks.

>Need to add a "typename" in front of the remove_const inside is_const.

Ah, yes of course.

>Also I would suggest not giving the typedef the name "type" when it is
>a static member. Perhaps "value" would be better?

I've been experimenting with using "type" in place of "value". Which
reads better?

     if (is_const<T>::value)
          ...
or
     if (is_const<T>::type)
          ...

I had been leaning toward "type". But you having to remind me to put the
"typename" in is a pretty strong argument for reserving "type" for type
names! :-)

>Also, for
>portability, keep in mind that initialization of static members inside
>the class definition doesn't work with some compilers (even when they
>are bool/int/etc.) Might be easier to stick with enums.

OTOH, are there any compilers that do support enough partial template
specialization to make this work, and don't support static const integral
data initialization?

-Howard


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