|
Boost : |
Subject: Re: [boost] [config] Configuring for C++14 and later library features.
From: Michel Morin (mimomorin_at_[hidden])
Date: 2015-04-24 10:07:29
I came up with this idea:
Boost.Config provides header files for each library feature (i.e. one header
per one feature), but <config.hpp> does not include those headers.
When users need a macro, the corresponding header needs to be included.
Feature detection macros are provided as follows:
[1]
In traditional stdlib headers (i.e. <config/stdlib/****.hpp>),
macros `BOOST_OPTOUT_SOME_FEATURE` and `BOOST_OPTIN_SOME_FEATURE` are defined
if necessary:
`BOOST_OPTOUT_SOME_FEATURE`
If library feature is broken even if SD-6 macro is defined,
we define the macro to opt-out the feature.
`BOOST_OPTIN_SOME_FEATURE`
If library feature is implemented even if SD-6 macro is not defined,
we define the macro to opt-in the feature.
[2]
Then, Boost.Config provides <config/library_features/some_feature.hpp> as
#include <xxxx> // the corresponding std header
#include <boost/config.hpp>
#if (__cpp_lib_some_feature < YYYYMM || defined(BOOST_OPTOUT_SOME_FEATURE)) \
&& !defined(BOOST_OPTIN_SOME_FEATURE)
#define BOOST_NO_CXX_LIB_SOME_FEATURE
#endif
Another option would be, if someone volunteers, asking the standard committee
for a new standard header <feature_macros> ;)
Regards,
Michel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk