Boost logo

Boost :

Subject: Re: [boost] [config] Positive feature macros, r2
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2018-01-26 17:37:28


AMDG

On 01/26/2018 08:30 AM, Peter Dimov via Boost wrote:
>
> As written, this does not allow the latter. The general case is:
>
> // prefix.hpp:
>
> #if defined(__cpp_foo) && __cpp_foo >= 201400
> # define BOOST_CXX14_FOO
> #endif
>
> // compiler/bar.hpp:
>
> #if __BAR_VERSION__ >= 12 && __BAR_VERSION__ < 18
> // have foo, don't have feature macros yet
> # define BOOST_CXX14_FOO
> #endif
>
> #if __BAR_VERSION__ == 21 && __cplusplus >= 201700
> // bar++ version 21 has a bug in foo in -std=c++17 mode
> # undef BOOST_CXX14_FOO
> #endif
>
> If you define to 0 or 1 in prefix.hpp, the information of whether the
> user overrode is lost, and the compiler-specific config can still stomp
> over the user define.
>
Just apply the defaults after the compiler specific
configuration instead of before, and there's no problem.

In Christ,
Steven Watanabe


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