« Return to Thread: Using multiple versions of Boost

Re: Using multiple versions of Boost

by Marcus Lindblom :: Rate this Message:

Reply to Author | View in Thread

Jody Hagins wrote:

> One of the things I did in this particular library, is version itself
> with a macro like so in say, foo/common.hpp
>
> #define FOO_NAMESPACE PP_build_namespace(foo, FOO_MAJOR_VERSION)
> namespace FOO_NAMESPACE { }
> namespace foo = FOO_NAMESPACE;
>
> This means that all code can use the alias "foo" as the namespace name.
>
> The only problem is that the namespace can not be reopened with "foo"
> but must be reopened with the macro name...
>  
FWIW, The Xerces C++ API uses the same techinique to version their
libraries. It also has issues with forward declaration, as that, also,
needs to be done in the correct namespace.

/Marcus
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

 « Return to Thread: Using multiple versions of Boost