Namespace Alias

A namespace-alias is an alternative name for a namespace.

Syntax

namespace-alias :

identifier

namespace-alias-definition :

namespace identifier = qualified-namespace-specifier;

qualified-namespace-specifier :

::opt nested-name-specifieropt class-or-namespace-name

A namespace-alias-definition declares an alternate name for a namespace. The identifier is a synonym for the qualified-namespace-specifier and becomes a namespace-alias. For example:

namespace a_very_long_namespace_name { ... }
namespace AVLNN = a_very_long_namespace_name;
// AVLNN is now a namespace-alias for a_very_long_namespace_name.

A namespace-name cannot be identical to any other entity in the same declarative region. In addition, a global namespace-name cannot be the same as any other global entity name in a given program.