On 6/7/2015 1:29 PM, Peter Dimov wrote:
John Maddock wrote:
Right. But if lib X prefers/needs to use the Boost version always, they don't have to use this mechanism.
What I'm saying is more like lib X has a dual interface, but _the user_ of lib X wants to use the boost:: version, whereas lib X detects C++11 and provides the std:: version.
Lib X is
#if CXX11
void libx_f( std::regex const & rx );
#else
void libx_f( boost::regex const & rx );
#endif
but the user wants to continue using boost::regex under C++11.
This could in principle be addressed in some way by giving the user the option to override libX's decision to go with std::regex.
I have thought of letting the end-user override libX's decision. For a currently supported XXX library in my macro system I could allow a BOOST_CPP_XXX_USE_BOOST be defined by the user which would force the use of the Boost library even in C++11 mode. I have also contemplated a convenient BOOST_CPP_USE_BOOST macro being defined by the end-user which would force the use of a Boost library for any XXX library in C++11 mode. Programming this idea into my macro system is trivial. But suppose compiling in C++11 mode one TU has BOOST_CPP_XXX_USE_BOOST defined and another TU does not and both include some interface affected by this decision. I think in this case KISS is better than the kiss of death <g>.