Boost logo

Boost :

Subject: Re: [boost] [config][mpl][type_traits][integer] BOOST_STATIC_CONSTANT should use constexpr
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-04-20 08:48:31

Le 20/04/13 14:33, Vicente J. Botet Escriba a écrit :
> Le 20/04/13 13:18, Antony Polukhin a écrit :
>> 2013/4/20 John Maddock<boost.regex_at_[hidden]>:
>> <...>
>>> 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.
>> Oh, now I see, thanks.
>>> As for the original question, this is such a pervasive breaking change, I
>>> think a new macro is inevitable I'm afraid :-(
>> New macro will do exactly what the old macro did, but using C++11
>> feature. Code in all Boost libraries will be changed to use new macro.
>> So the old macro will be required only for users code that use macro
>> and attempts to take address of constant...
>> To me, it looks less obscuring to have one macro and a note for users
>> to use BOOST_CONSTEXPR_OR_CONST for out-of-line definition; than two
>> macro (which one shall be used by default?) that do the same thing but
>> very slightly differ in details.
> Just to add some information about some uses
> 113
> grep -r BOOST_STATIC_CONST * | wc -l
> 6598

The figures are a little bit better :)

grep -r BOOST_STATIC_CONSTANT * | grep -v svn | wc -l
grep -r BOOST_NO_INCLASS_MEMBER_INITIALIZATION * | grep -v svn | wc -l


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