Is there a way to discount the namespace?

Short: is there a way to discount the namespace in gcc or clang?

Long:

Over the years, we have accumulated all sorts of things in the namespace. Now we decided to put some order in it and divide the namespace into the correctly 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 in several include files. And all there is inline / boilerplate code; therefore there are no libraries associated with it.

The obvious solution would be to copy all the definitions from the old namespace to the new ones and mark everything in the old namespace as obsolete, in parts.

We cannot just rename a namespace without breaking multiple projects.

, - , , , .

gcc 4.7.3 , clang, gcc; - .

+4
1

, , # warning . libstd++ . , MSVC, .

+2

Source: https://habr.com/ru/post/1534619/


All Articles