Boost logo

Boost :

Subject: Re: [boost] version conflicts: is there a solution?
From: Artyom (artyomtnk_at_[hidden])
Date: 2009-06-24 00:18:34


Hi,

Take a look on this namespace renaming script:

http://lists.boost.org/Archives/boost/2009/05/151816.php

It should work, not sure about correctness of build system.
I consider to submit it officially once it polished, but it
seems to work.

Artyom

--- On Wed, 6/24/09, Lewis Hyatt <lhyatt_at_[hidden]> wrote:

> From: Lewis Hyatt <lhyatt_at_[hidden]>
> Subject: [boost] version conflicts: is there a solution?
> To: boost_at_[hidden]
> Date: Wednesday, June 24, 2009, 3:49 AM
> Hi Everyone-
>
> This has been discussed before
> (http://thread.gmane.org/gmane.comp.lib.boost.devel/180008),
> but I think my
> question is along a slightly different line so I thought I
> would ask about it.
> Let's say I want to compile and distribute a library
> (without the source), and I
> happen to use some boost header-only libraries as an
> implementation detail in
> some of my functions. None of the headers associated with
> my library include
> boost headers; it's purely an internal detail.
>
> Now, it seems to me that users of my library will still
> have to be aware of the
> fact that I used boost in my implementation --
> specifically, if they happen to
> use different versions of the same boost libraries in their
> code, then the ODR
> is violated and the behavior is undefined.
>
> I realize this isn't a boost-specific problem (it would
> affect any library of
> template functions), but I am wondering if there is a
> boost-specific solution
> already worked out? Has anyone thought about this? It seems
> to me that in this
> case, what would be ideal would be if I could do:
>
> #define BOOST_NAMESPACE some_unique_namespace_for_boost
> #include "boost/algorithm/string.hpp"
> BOOST_NAMESPACE::shared_ptr<void> x; //or whatever
>
> Then I can insure there are no ODR violations and I don't
> need to bother users
> of my library with the fact that I used boost at all.
>
> Other than the sheer annoyance of having to go through all
> the boost code to use
> this macro, is there a strong downside to this approach?
>
> Alternatively, I could try:
>
> namespace {
>     #include "boost/..."
> }
>
> But I don't know, could this work? Or are there boost
> headers that rely on fully
> qualified references like ::boost::algorithm::whatever?
>
> I'd appreciate anyone's thoughts on this issue, thanks!
>
> -Lewis
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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