Boost logo

Boost :

Subject: Re: [boost] Breaking existing libraries
From: Robert Ramey (ramey_at_[hidden])
Date: 2008-12-03 17:54:28


David Abrahams wrote:
> on Mon Nov 24 2008, Matthias Schabel <boost-AT-schabel-family.org>
> wrote:
>
>> This is a somewhat tangential thought, but ... what if each release
>> of the Boost libraries
>> was put into its own namespace, so we have code in
>>
>> namespace boost_1_38_0 { ... }
>>
>> rather than in namespace boost. Then, in end user code, you just
>> need :
>>
>> using namespace boost = boost_1_38_0;
>>
>> It seems like this would allow certain deprecated Boost components
>> (those that are not too strongly coupled
>> to the rest of Boost) to be used at the same time as more recent
>> components from other libraries :
>>
>> using boost_1_32_0::iterator_range;
>>
>> iterator_range<some_iterator> rng;
>>
>> which might sidestep some of the recent iterator_range anarchy, and
>> simplify other major transitions. N.B. I
>> haven't really thought about the ramifications of doing this, so the
>> idea might be completely unworkable in
>> practice.
>

> It also allows multiple versions of boost to exist in the same
> executable without ODR violations. The ability to configure boost
> that way would be most welcome.

Let's take this to its logical conclusion:

suppose that there exists spirit160 (works with borland), spirit180, and
just spirit(might not work for me) - the latest version

Then I could say: ?

namespace boost {
    #if BORLAND
    using namespace spirit = sprit_160 // too old for most compilers
    #elseif TESTING
    using namespace spirit = spirit// too new for most compilers
    #else
    using namespace spririt = spirit_180 // just rig
    #endif
...
}

To be able to maintain stuffworking in an environment where libraries
have broken their original interfaces would be most welcome. Of
course only the lastest would need testing on a regular basis.

Robert Ramey


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