tmp/tmp4clj96xm/{from.md → to.md}
RENAMED
|
@@ -180,13 +180,13 @@ namespace unique '{' namespace-body '}'
|
|
| 180 |
```
|
| 181 |
|
| 182 |
where `inline` appears if and only if it appears in the
|
| 183 |
*unnamed-namespace-definition* and all occurrences of *`unique`* in a
|
| 184 |
translation unit are replaced by the same identifier, and this
|
| 185 |
-
identifier differs from all other identifiers in the
|
| 186 |
-
|
| 187 |
-
|
| 188 |
|
| 189 |
[*Example 1*:
|
| 190 |
|
| 191 |
``` cpp
|
| 192 |
namespace { int i; } // unique::i
|
|
@@ -210,59 +210,71 @@ void h() {
|
|
| 210 |
|
| 211 |
— *end example*]
|
| 212 |
|
| 213 |
### Namespace alias <a id="namespace.alias">[[namespace.alias]]</a>
|
| 214 |
|
| 215 |
-
A *namespace-alias-definition* declares
|
| 216 |
-
|
| 217 |
|
| 218 |
``` bnf
|
| 219 |
namespace-alias:
|
| 220 |
identifier
|
| 221 |
```
|
| 222 |
|
| 223 |
``` bnf
|
| 224 |
namespace-alias-definition:
|
| 225 |
namespace identifier '=' qualified-namespace-specifier ';'
|
|
|
|
| 226 |
```
|
| 227 |
|
| 228 |
``` bnf
|
| 229 |
qualified-namespace-specifier:
|
| 230 |
nested-name-specifierₒₚₜ namespace-name
|
| 231 |
```
|
| 232 |
|
|
|
|
|
|
|
|
|
|
| 233 |
The *identifier* in a *namespace-alias-definition* becomes a
|
| 234 |
-
*namespace-alias*
|
| 235 |
-
|
|
|
|
|
|
|
|
|
|
| 236 |
|
| 237 |
[*Note 1*: When looking up a *namespace-name* in a
|
| 238 |
*namespace-alias-definition*, only namespace names are considered, see
|
| 239 |
[[basic.lookup.udir]]. — *end note*]
|
| 240 |
|
| 241 |
### Using namespace directive <a id="namespace.udir">[[namespace.udir]]</a>
|
| 242 |
|
| 243 |
``` bnf
|
| 244 |
using-directive:
|
| 245 |
attribute-specifier-seqₒₚₜ using namespace nested-name-specifierₒₚₜ namespace-name ';'
|
|
|
|
| 246 |
```
|
| 247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 248 |
A *using-directive* shall not appear in class scope, but may appear in
|
| 249 |
namespace scope or in block scope.
|
| 250 |
|
| 251 |
[*Note 1*: When looking up a *namespace-name* in a *using-directive*,
|
| 252 |
only namespace names are considered, see
|
| 253 |
[[basic.lookup.udir]]. — *end note*]
|
| 254 |
|
| 255 |
The optional *attribute-specifier-seq* appertains to the
|
| 256 |
*using-directive*.
|
| 257 |
|
| 258 |
-
[*Note 2*: A *using-directive* makes the names in the
|
| 259 |
namespace usable in the scope in which the *using-directive* appears
|
| 260 |
after the *using-directive* [[basic.lookup.unqual]], [[namespace.qual]].
|
| 261 |
During unqualified name lookup, the names appear as if they were
|
| 262 |
declared in the nearest enclosing namespace which contains both the
|
| 263 |
-
*using-directive* and the
|
| 264 |
|
| 265 |
[*Note 3*: A *using-directive* does not introduce any
|
| 266 |
names. — *end note*]
|
| 267 |
|
| 268 |
[*Example 1*:
|
|
@@ -296,13 +308,13 @@ void f4() {
|
|
| 296 |
```
|
| 297 |
|
| 298 |
— *end example*]
|
| 299 |
|
| 300 |
[*Note 4*: A *using-directive* is transitive: if a scope contains a
|
| 301 |
-
*using-directive* that
|
| 302 |
-
*using-directive*s, the namespaces
|
| 303 |
-
are also eligible to be considered. — *end note*]
|
| 304 |
|
| 305 |
[*Example 2*:
|
| 306 |
|
| 307 |
``` cpp
|
| 308 |
namespace M {
|
|
|
|
| 180 |
```
|
| 181 |
|
| 182 |
where `inline` appears if and only if it appears in the
|
| 183 |
*unnamed-namespace-definition* and all occurrences of *`unique`* in a
|
| 184 |
translation unit are replaced by the same identifier, and this
|
| 185 |
+
identifier differs from all other identifiers in the program. The
|
| 186 |
+
optional *attribute-specifier-seq* in the *unnamed-namespace-definition*
|
| 187 |
+
appertains to *`unique`*.
|
| 188 |
|
| 189 |
[*Example 1*:
|
| 190 |
|
| 191 |
``` cpp
|
| 192 |
namespace { int i; } // unique::i
|
|
|
|
| 210 |
|
| 211 |
— *end example*]
|
| 212 |
|
| 213 |
### Namespace alias <a id="namespace.alias">[[namespace.alias]]</a>
|
| 214 |
|
| 215 |
+
A *namespace-alias-definition* declares a *namespace alias* according to
|
| 216 |
+
the following grammar:
|
| 217 |
|
| 218 |
``` bnf
|
| 219 |
namespace-alias:
|
| 220 |
identifier
|
| 221 |
```
|
| 222 |
|
| 223 |
``` bnf
|
| 224 |
namespace-alias-definition:
|
| 225 |
namespace identifier '=' qualified-namespace-specifier ';'
|
| 226 |
+
namespace identifier '=' splice-specifier ';'
|
| 227 |
```
|
| 228 |
|
| 229 |
``` bnf
|
| 230 |
qualified-namespace-specifier:
|
| 231 |
nested-name-specifierₒₚₜ namespace-name
|
| 232 |
```
|
| 233 |
|
| 234 |
+
The *splice-specifier* (if any) shall designate a namespace that is not
|
| 235 |
+
the global namespace.
|
| 236 |
+
|
| 237 |
The *identifier* in a *namespace-alias-definition* becomes a
|
| 238 |
+
*namespace-alias*.
|
| 239 |
+
|
| 240 |
+
The underlying entity [[basic.pre]] of the namespace alias is the
|
| 241 |
+
namespace either denoted by the *qualified-namespace-specifier* or
|
| 242 |
+
designated by the *splice-specifier*.
|
| 243 |
|
| 244 |
[*Note 1*: When looking up a *namespace-name* in a
|
| 245 |
*namespace-alias-definition*, only namespace names are considered, see
|
| 246 |
[[basic.lookup.udir]]. — *end note*]
|
| 247 |
|
| 248 |
### Using namespace directive <a id="namespace.udir">[[namespace.udir]]</a>
|
| 249 |
|
| 250 |
``` bnf
|
| 251 |
using-directive:
|
| 252 |
attribute-specifier-seqₒₚₜ using namespace nested-name-specifierₒₚₜ namespace-name ';'
|
| 253 |
+
attribute-specifier-seqₒₚₜ using namespace splice-specifier ';'
|
| 254 |
```
|
| 255 |
|
| 256 |
+
The *splice-specifier* (if any) shall designate a namespace that is not
|
| 257 |
+
the global namespace. The *nested-name-specifier*, *namespace-name*, and
|
| 258 |
+
*splice-specifier* shall not be dependent.
|
| 259 |
+
|
| 260 |
A *using-directive* shall not appear in class scope, but may appear in
|
| 261 |
namespace scope or in block scope.
|
| 262 |
|
| 263 |
[*Note 1*: When looking up a *namespace-name* in a *using-directive*,
|
| 264 |
only namespace names are considered, see
|
| 265 |
[[basic.lookup.udir]]. — *end note*]
|
| 266 |
|
| 267 |
The optional *attribute-specifier-seq* appertains to the
|
| 268 |
*using-directive*.
|
| 269 |
|
| 270 |
+
[*Note 2*: A *using-directive* makes the names in the designated
|
| 271 |
namespace usable in the scope in which the *using-directive* appears
|
| 272 |
after the *using-directive* [[basic.lookup.unqual]], [[namespace.qual]].
|
| 273 |
During unqualified name lookup, the names appear as if they were
|
| 274 |
declared in the nearest enclosing namespace which contains both the
|
| 275 |
+
*using-directive* and the designated namespace. — *end note*]
|
| 276 |
|
| 277 |
[*Note 3*: A *using-directive* does not introduce any
|
| 278 |
names. — *end note*]
|
| 279 |
|
| 280 |
[*Example 1*:
|
|
|
|
| 308 |
```
|
| 309 |
|
| 310 |
— *end example*]
|
| 311 |
|
| 312 |
[*Note 4*: A *using-directive* is transitive: if a scope contains a
|
| 313 |
+
*using-directive* that designates a namespace that itself contains
|
| 314 |
+
*using-directive*s, the namespaces designated by those
|
| 315 |
+
*using-directive*s are also eligible to be considered. — *end note*]
|
| 316 |
|
| 317 |
[*Example 2*:
|
| 318 |
|
| 319 |
``` cpp
|
| 320 |
namespace M {
|