Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2001-09-05 06:29:30

>Initially, I couldn't compile Douglas code because Borland C++ 5.5 kept
>crashing with an internal compiler error.

Have you tried 5.51 - it's much more stable than 5.50 if that's what you
are using...

>First, although the borland compiler does recognize:
> static const int v = 1 ;
>it seems to treat it differently than:
> enum { v = 1 } ;
>since the former can't be used as a non-type template parameter while the
>later can.
>This forced me to wrap constants defined with BOOST_STATIC_CONSTANT in
>an enum.

That's not my experience - provided you are careful you can use
BOOST_STATIC_CONSTANT (see more/int_const_guidelines.htm for all the
workarounds you may need) - I've also found that while you can nearly
always use enum's in constant expressions, they sometimes have a garbage
value (usually zero) when used in that way. Since this is a silent
failure, it's generally best to use static const int's, that way you know
when there is a problem.

- John Maddock

Boost list run by bdawes at, gregod at, cpdaniel at, john at