Generally speaking, the only advantage I see with namespace aliases is that they can be anywhere. Take the following example:
namespace a
{
namespace that_is_a_great_namespace
{
namespace b = that_is_a_great_namespace;
}
}
namespace that_is_a_great_namespace {}
You won't be able to define a macro that will convert a::that_is_a_great_namespace
to a::b
with no side effect. Here, that_is_a_great_namespace
will also be converted to b
. Namespace aliases help to resolve name conflicts in those cases.
However, if you already use #defines
and it already works, refactoring your code for such a rare case may not be useful.