Boost logo

Boost :

Subject: Re: [boost] [config][mpl][type_traits][integer] BOOST_STATIC_CONSTANT should use constexpr
From: John Maddock (boost.regex_at_[hidden])
Date: 2013-04-20 06:52:06


>> #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
>> template <int b1, int b2> bool const ice_eq<b1,b2>::value; // *********
>> template <int b1, int b2> bool const ice_ne<b1,b2>::value; // *********
>> #endif
>>
>> for which I have needed to change const by BOOST_CONSTEXPR_OR_CONST.
> <...>
>> What am I missing?
>
> Looks like it shall be
> #ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
> not #ifndef
>
> But how did it work before? Or nobody tested it on ancient compilers?

No that's correct as is:

* if BOOST_NO_INCLASS_MEMBER_INITIALIZATION is defined, then the constant is
really an enum and there should be no out-of-line definitions.
* if BOOST_NO_INCLASS_MEMBER_INITIALIZATION is *not* defined, then the
constant *should* have the out-of-line definition in case it's address is
taken/used.

As for the original question, this is such a pervasive breaking change, I
think a new macro is inevitable I'm afraid :-(

John.


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