|
Boost : |
From: Gabriel Dos Reis (Gabriel.Dos-Reis_at_[hidden])
Date: 1999-12-22 19:09:31
Howard Hinnant <hinnant_at_[hidden]> writes:
| >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! :-)
I was preferring 'type', but I guess that doesn't really matter. Just
pick what you like.
| >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?
I don't know of such compilers. Probably Jeremy has some data...
-- Gaby
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk