Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2003-01-09 05:34:58


Terje Slettebø wrote:
>
> > Just to make sure: Do you "vote" in favor of enums? I have seen problems
> > with 'static const ...', but I have never seen problems with enums
> > (although they theoretically exist).
>
> Not just theoretically. As mentioned in an earlier posting in this thread,
> BCC doesn't work well with enums, but it does work with static const. Also,
> there's the issues pointed out by Paul Mensonides, due to the fact that
> enums are UDTs.

Sorry, I should have been more exact. Of course we can only choose a
"default" implementation. If a compiler is buggy, we need to work-around
anyway. The drawback of enums, mentioned by Paul, is the one I call
theoretically, as I have never found this to be a problem in the real
world (well, in *my* real world :). A problem like this can be *created*
but special code which I have yet to see in "normal" programs. OTOH I
have already seen a colleage wondering about link-failures due to
passing a 'static const int ...' to a function which took a 'const T&'.
I consider this much more likely to happen in daily programming, YMMV :)

Regards, Daniel

-- 
Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de

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