From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-09-18 07:11:47
Anthony Williams wrote:
> Markus Schöpflin writes:
> > I think we have a problem with BOOST_STATIC_CONSTANT() then as it
> > provides no definition (just the declaration) for the static
> > constant if the macro BOOST_NO_INCLASS_MEMBER_INITIALIZATION is
> > not defined.
> Strictly, yes we do. However, this is one of those
> it-works-in-all-compilers-and-will-hopefully-soon-be-standard features (like
> assuming vectors had contiguous storage used to be). At least, it works on
> compilers that support in-class initialization of static constants.
I think I have discovered a compiler that supports the latter (in-class
initialization of static constants) but still requires a definition for
the static constant, template or not. It's IBM's vacpp 5. :-) Of course
you can work around this by defining BOOST_NO_INCLASS_MEMBER_INITIALIZATION
(which is defined in the current configuration) but I have been wondering
if this really is the fault of the compiler.
> Also, in many cases, it is actually very hard to define the constant outside
> the class definition.
> If such usage was banned, it would just lead to a more prolific use of enums
> for this purpose, which is really a hack.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk