Not actually. You may rename namespace if you have namespace with a very long name: namespace verylongnameofthenamecpace { } namespace A = verylongnameofthenamecpace; or simplify usage of nested: namespace A { namespace A { namespace A { } } } namespace B = A::A::A; Also some rare problems are faced here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1526.txt
One more power feature to be misused?
ReplyDeleteNot actually.
ReplyDeleteYou may rename namespace if you have namespace with a very long name:
namespace verylongnameofthenamecpace
{
}
namespace A = verylongnameofthenamecpace;
or simplify usage of nested:
namespace A
{
namespace A
{
namespace A
{
}
}
}
namespace B = A::A::A;
Also some rare problems are faced here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1526.txt
As Ni@m mentioned, it's useful when dealing with namespaces with long names, or that are deeply nested.
ReplyDeleteYou'll appreciate namespace aliasing when you spend some time with the boost libraries.
I've written a bit more about it's utility here: http://www.juicydata.com/CppNamespaceAlias.