Boost logo

Boost :

From: Matthias Troyer (troyer_at_[hidden])
Date: 2004-01-27 07:15:39


Dear Daniel,

If you use BOOST_STATIC_CONSTANT you need to additionally provide a
definition on conforming compilers. The correct usage is like in:

// declaration
class A {
   BOOST_STATIC_CONSTANT(int , x=1);
};

....

//definition
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
int A::x;
#endif

I hope that clarifies this issue,

Matthias

On Jan 27, 2004, at 11:13 AM, Daniel Krügler wrote:

> Dear boosters,
>
> BOOST_STATIC_CONSTANT is a useful wrapper for compiler
> deficiencies regarding ICE's and is one of the most
> important corner stones inside boost, especially in the
> boost MP library.
>
> Full compliant compilers would translate this macro into:
>
> static const IntegralOrEnumerationType name_of_IC = ICE;
>
> others translate it into:
>
> enum { name_of_IC = ICE };
>
  [snip]
> - Assumption one: Boost does not provide the definitions of
> potential static constants hidden by the BOOST_STATIC_CONSTANT
> definition (I used only the headers of the library, so my potential
> testing bug would be that I had to include the corresponding
> translation units of boost providing the constant's definitions,
> but sorry - I did not find them!).
> As I said: If this assumption is false, please blame me straight
> for incomplete testing and for trying to spread bad rumors on this
> (really!) great library.


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