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 07:05:39


Le 20/04/13 12:12, Antony Polukhin a écrit :
> 2013/4/20 Vicente J. Botet Escriba <vicente.botet_at_[hidden]>:
> <...>
>> #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?
The documentation says

|BOOST_NO_INCLASS_MEMBER_INITIALIZATION|

        

Compiler

        

Compiler violates std::9.4.2/4.

and

9.4.2 Static data members [class.static.data]
2 The declaration of a static data member in its class definition is not
a definition and may be of an incomplete
type other than cv-qualified void. The definition for a static data
member shall appear in a namespace
scope enclosing the member's class definition.

I think that the definition must be done when
|BOOST_NO_INCLASS_MEMBER_INITIALIZATION is not defined, but the
initialization could be done on the declaration.

Could someone clarify this point?

Best,
Vicente
|


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