You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each template-declaration D introduces a template parameter scope that extends from the beginning of its template-parameter-list to the end of the template-declaration. Any declaration outside the template-parameter-list that would inhabit that scope instead inhabits the same scope as D.
Since we have said that the template-declaration D introduced a template scope that is extended to the end of D before we state the second sentence. According to [basic.scope.scope] p2
A declaration inhabits the immediate scope at its locus
Consider this example
template<classT>
structX{};
The locus of the class-specifier is immediately after X, that is, the locus of the class specifier is contained by the template parameter scope. This makes what scope D inhabits ambiguous. The intent is to say that D inhabits the global scope. The improvement might be:
Each template-declaration D introduces a template parameter scope P that extends from the beginning of its template-parameter-list to the end of the template-declaration. Any declaration outside the template-parameter-list that would inhabit the scope P instead inhabits the same scope as that D would inhabit if the scope P were ignored.
Or, we can just say
Each template-declaration D introduces a template parameter scope P that extends from the beginning of its template-parameter-list to the end of the template-declaration. D inhabits the scope S after ignoring P. Any declaration outside the template-parameter-list that would inhabit the scope P instead inhabits S.
The text was updated successfully, but these errors were encountered:
[basic.scope.temp] p2 says
Since we have said that the template-declaration
D
introduced a template scope that is extended to the end ofD
before we state the second sentence. According to [basic.scope.scope] p2Consider this example
The locus of the class-specifier is immediately after
X
, that is, the locus of the class specifier is contained by the template parameter scope. This makes what scopeD
inhabits ambiguous. The intent is to say thatD
inhabits the global scope. The improvement might be:Or, we can just say
The text was updated successfully, but these errors were encountered: