Boost logo

Boost :

Subject: Re: [boost] [Config] Multiple versions of Boost
From: Sohail Somani (sohail_at_[hidden])
Date: 2008-09-13 13:34:57


Steven Watanabe wrote:
> AMDG
>
> Sohail Somani wrote:
>> 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!
>>
>
> There is actually a worse problem. Any solution involving
> a namespace alias will break code like:
>
> namespace boost {
> namespace fusion {
> namespace extension {
> template<>
> struct begin_impl<...> { ... };
> }
> }
> }

Hm, that is definitely an extension point. STLport gets around this
problem because they never have to #include INCLUDE something that has
"std" in it. Similarly for Xalan and Xerces. So they can just #define
std my_special_std.

Is there any conforming way to prevent the following from replacing the
boost token?

#define boost boost_1
#define INCLUDE <boost/foo/bar.hpp>
#include INCLUDE

Still, I wonder if this is the only problem once solved.

-- 
Sohail Somani
http://uint32t.blogspot.com

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