
Steven Watanabe wrote:
AMDG
Sohail Somani wrote:
Sohail Somani wrote: [snip]
What if Boost.Config did something like:
#if !defined(BOOST) # define BOOST boost #endif
And we replace all uses of the boost namespace with BOOST?
Would such a patch against trunk be acceptable? What are the problems?
In order to make this work we need to make sure that there is a namespace alias where appropriate:
#if !defined(BOOST_NAMESPACE) #define BOOST_NAMESPACE boost #endif
#define BOOST_NAMESPACE_boost 0
#if BOOST_PP_CAT(BOOST_NAMESPACE_, BOOST_NAMESPACE) namespace BOOST_NAMESPACE {} namespace boost = BOOST_NAMESPACE; #endif
#undef BOOST_NAMESPACE_boost
Indeed, you are right. Clever too :-) There is one obvious problem I see with the -DBOOST_NAMESPACE=foo approach: there is no way to include two versions of Boost within the same translation unit. Unfortunately, I don't think there would be any acceptable way to do this. Though I'm sure you will come back with a way to do it! By the way, I've received a message on IRC telling me that Xalan and Xerces do something very similar so it wouldn't be totally unprecedented. -- Sohail Somani http://uint32t.blogspot.com