Boost logo

Boost :

Subject: Re: [boost] [config] BOOST_STATIC_CONSTEXPR in C++11 vs C++14
From: Lakshay Garg (lakshayg373_at_[hidden])
Date: 2017-08-22 18:12:08


On 22 August 2017 at 23:33, John Maddock via Boost
<boost_at_[hidden]> wrote:
>
>
> On 22/08/2017 17:18, Gary Furnish via Boost wrote:
>>
>> I'd take a look at making something like BOOST_CONSTEXPR_AND_CONST
>> similarly to BOOST_CONSTEXPR_OR_CONST using BOOST_CXX14_CONSTEXPR.
>> See
>> http://www.boost.org/doc/libs/1_65_0/libs/config/doc/html/boost_config/boost_macro_reference.html
>> But I'd name it something like BOOST_COMPILETIME_CONSTANT because
>> BOOST_CONSTEXPR_AND_CONST would seem to imply always constexpr and
>> const, which is not what you want. Really though you want to get
>> other people who are more knowledgeable then I am involved if you want
>> to add a cross-library macro, so maybe make one for your use case to
>> test it.
>
>
> Actually I think it's a lot simpler than this: when it was added,
> |BOOST_CONSTEXPR_OR_CONST did what it says, and what it's documented to do -
> namely declare something const or constexpr (which implied const at the
> time). Subsequently it's been broken by C++14 where constexpr no longer
> implies const. It just needs updating is all, and fixing that will

But if we continue to call it BOOST_CONSTEXPR_OR_CONST, it would mean
something that is not compliant with the C++14 standard. Shouldn't we have
another macro, very similar to BOOST_CONSTEXPR_OR_CONST, just handling
the case for C++14 in a different manner.

Lakshay


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