
Roland Schwarz wrote:
I have written a little perl script 'renamespace' that can be used to rename a namespace identifier for a single file or a whole project tree. The script is attached to this mail and is self-documenting. Just execute it with --help option to learn more.
The script has a special short-hand mode to version an entire boost tree. In addition it modifies two boost files: version.hpp and config.hpp. The first gets an additional macro BOOST_VERSIONED_NAMESPACE and the other is modified with a namespace alias (which can be turned off by the user if needed.) The net result is that it is possible with no change to the user code to build against this versioned boost tree.
One caveat: User code that needs to reopen the boost namespace has to reopen the versioned namespace of course. (This can be automated with some additional macros in the user code.) One typical case where this will be necessary is when using the serialization library.
I've put the script under the boost license, so if you think it is useful I would be glad to contribute it to the tools directory.
This is really cool. I have also had to solve this problem before. I managed to get away with /Dboost=boost_133_1 since it was on a small subset of Boost on a specific compiler. I will use your script next time I have to solve this problem properly. Please add it :-) -- Sohail Somani http://uint32t.blogspot.com