|
Boost : |
From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-01-07 18:22:20
On Tue, 7 Jan 2003 15:35:56 +0100, Terje Slettebø
<tslettebo_at_[hidden]> wrote:
[...]
>I like static const, as I think it conveys more succinctly what it's about,
>and the enum appears more like a hack (for compilers not handling static
>const in-class initialisation). However, if this means it may need an
>out-of-class definition, as well, perhaps this could need to be
>reconsidered?
It *may* need out-of-class definition, as you say. This could also be
a boost FAQ ;-)
http://lists.boost.org/MailArchives/boost/msg35797.php
As to deprecating BOOST_STATIC_CONSTANT, which David B. Held proposed,
I don't think it is a good idea. There is code that works well either
with static const and with the enum in its 'normal' use, but fails
miserably when used in other contexts where the type of the constant
matters. BOOST_STATIC_CONSTANT allows at least the most common uses
with broken compilers.
Genny.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk