9
Declarations
[dcl.dcl]
9.8
Namespaces
[basic.namespace]
9.8.3
Namespace alias
[namespace.alias]
1
#
A
namespace-alias-definition
declares an alternate name for a namespace according to the following grammar:
namespace-alias
:
identifier
namespace-alias-definition
:
namespace
identifier
=
qualified-namespace-specifier
;
qualified-namespace-specifier
:
nested-name-specifier
o
p
t
namespace-name
2
#
The
identifier
in a
namespace-alias-definition
is a synonym for the name of the namespace denoted by the
qualified-namespace-specifier
and becomes a
namespace-alias
.
[
Note
1
:
When looking up a
namespace-name
in a
namespace-alias-definition
, only namespace names are considered, see
[basic.
lookup.
udir]
.
—
end note
]
3
#
In a declarative region, a
namespace-alias-definition
can be used to redefine a
namespace-alias
declared in that declarative region to refer only to the namespace to which it already refers
.
[
Example
1
:
The following declarations are well-formed:
namespace
Company_with_very_long_name
{
/* ... */
}
namespace
CWVLN
=
Company_with_very_long_name;
namespace
CWVLN
=
Company_with_very_long_name;
// OK: duplicate
namespace
CWVLN
=
CWVLN;
—
end example
]