Boost logo

Boost :

Subject: Re: [boost] [config] Rethinking feature macros?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2017-11-06 02:42:42


On 11/05/2017 07:30 PM, Peter Dimov via Boost wrote:
> Steven Watanabe wrote:
>> I think it's probably a bad idea for Boost.Config to try to define the
>> standard feature macros.
>> - #defining third-party macros in library code is a recipe for ODR
>> violations.
> There is no difference between defining __cpp_foo and BOOST_NO_CXX17_FOO
> as far as ODR violations are concerned. In both cases, before the
> inclusion of boost/config.hpp the macro isn't set, and after the
> inclusion, it may be.

This is only true assuming that
a) The only uses of these macros are inside Boost or
   by Boost users who explicitly #include Boost.Config
   to get them and,
b) No other (unrelated to Boost) library chooses to
   implement the same idea OR such a library is
   never used in the same translation unit as Boost.Config
   OR the definitions are exactly identical to Boost.Config
   (If the implementation of a feature is incomplete or buggy,
   different people may make different choices about whether
   to #define the feature macro).

In Christ,
Steven Watanabe

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