Files
2025-10-25 03:02:53 +03:00

24 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[basic.scope.namespace]
# 6 Basics [[basic]](./#basic)
## 6.4 Scope [[basic.scope]](basic.scope#namespace)
### 6.4.6 Namespace scope [basic.scope.namespace]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/basic.tex#L1501)
Any [*namespace-definition*](namespace.def.general#nt:namespace-definition "9.9.2.1General[namespace.def.general]") for a namespace N introduces
a [*namespace scope*](#def:scope,namespace "6.4.6Namespace scope[basic.scope.namespace]") that includes the [*namespace-body*](namespace.def.general#nt:namespace-body "9.9.2.1General[namespace.def.general]") for every [*namespace-definition*](namespace.def.general#nt:namespace-definition "9.9.2.1General[namespace.def.general]") for N[.](#1.sentence-1)
For each non-friend redeclaration or specialization
whose target scope is or is contained by the scope,
the portion after the[*declarator-id*](dcl.decl.general#nt:declarator-id "9.3.1General[dcl.decl.general]"),[*class-head-name*](class.pre#nt:class-head-name "11.1Preamble[class.pre]"), or[*enum-head-name*](dcl.enum#nt:enum-head-name "9.8.1Enumeration declarations[dcl.enum]") is also included in the scope[.](#1.sentence-2)
The global scope is
the namespace scope of the global namespace ([[basic.namespace]](basic.namespace "9.9Namespaces"))[.](#1.sentence-3)
[*Example [1](#example-1)*: namespace Q {namespace V { void f(); }void V::f() { // in the scope of Vvoid h(); // declares Q::V::h}} — *end example*]