The short: Is there a way to deprecate a namespace in gcc or clang?
The long:
Over the years, we have been accumulating all sort of stuff in a catch-all namespace. Now we have decided to put some order into it, and split the namespace into properly named ones; so:
namespace util
{
uint32_t codecID( const char * name ) ;
void alignStrings( std::vector< std::string > * strings ) ;
}
should become
namespace codec
{
uint32_t codecID( const char * name ) ;
}
namespace fmt
{
void alignStrings( std::vector< std::string > * strings ) ;
}
Just to add to the fun, the old namespace is defined across several include files. And everything in there is inline/template code; so there are no libraries associated with it.
The obvious solution would be to copy all definitions from the old namespace to the new ones and mark everything into the old namespace as deprecated, item by item.
We can't just rename the namespace without breaking several projects.
Now I'm wondering if there is a better way of doing something like this, such as marking the use of namespace util as deprecated.
We use gcc 4.7.3 as our production compiler, but build and test against clang to try and catch gcc specifics; so something working on any of those compilers would help.