37 lines
2.0 KiB
Markdown
37 lines
2.0 KiB
Markdown
[basic.scope.temp]
|
||
|
||
# 6 Basics [[basic]](./#basic)
|
||
|
||
## 6.4 Scope [[basic.scope]](basic.scope#temp)
|
||
|
||
### 6.4.9 Template parameter scope [basic.scope.temp]
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/basic.tex#L1566)
|
||
|
||
Each[*type-tt-parameter*](temp.param#nt:type-tt-parameter "13.2 Template parameters [temp.param]"),[*variable-tt-parameter*](temp.param#nt:variable-tt-parameter "13.2 Template parameters [temp.param]"), and[*concept-tt-parameter*](temp.param#nt:concept-tt-parameter "13.2 Template parameters [temp.param]") introduces
|
||
a [*template parameter scope*](#def:scope,template_parameter "6.4.9 Template parameter scope [basic.scope.temp]") that includes the [*template-head*](temp.pre#nt:template-head "13.1 Preamble [temp.pre]") of
|
||
the [*template-parameter*](temp.param#nt:template-parameter "13.2 Template parameters [temp.param]")[.](#1.sentence-1)
|
||
|
||
[2](#2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/basic.tex#L1576)
|
||
|
||
Each [*template-declaration*](temp.pre#nt:template-declaration "13.1 Preamble [temp.pre]") D introduces
|
||
a template parameter scope
|
||
that extends from the beginning of its [*template-parameter-list*](temp.pre#nt:template-parameter-list "13.1 Preamble [temp.pre]") to the end of the [*template-declaration*](temp.pre#nt:template-declaration "13.1 Preamble [temp.pre]")[.](#2.sentence-1)
|
||
|
||
Any declaration outside the [*template-parameter-list*](temp.pre#nt:template-parameter-list "13.1 Preamble [temp.pre]") that would inhabit that scope instead inhabits the same scope as D[.](#2.sentence-2)
|
||
|
||
The parent scope of any scope S that is not a template parameter scope
|
||
is the smallest scope that contains S and is not a template parameter scope[.](#2.sentence-3)
|
||
|
||
[*Note [1](#note-1)*:
|
||
|
||
Therefore, only template parameters belong to a template parameter scope, and
|
||
only template parameter scopes have
|
||
a template parameter scope as a parent scope[.](#2.sentence-4)
|
||
|
||
â *end note*]
|