
16 May
2007
16 May
'07
2:25 p.m.
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