tmp/tmpeau7jor4/{from.md → to.md}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
### Locally declared names <a id="temp.local">[[temp.local]]</a>
|
| 2 |
|
| 3 |
Like normal (non-template) classes, class templates have an
|
| 4 |
injected-class-name [[class.pre]]. The injected-class-name can be used
|
| 5 |
as a *template-name* or a *type-name*. When it is used with a
|
| 6 |
-
*template-argument-list*, as a *template-argument* for a template
|
| 7 |
-
|
| 8 |
*elaborated-type-specifier* of a friend class template declaration, it
|
| 9 |
is a *template-name* that refers to the class template itself.
|
| 10 |
Otherwise, it is a *type-name* equivalent to the *template-name*
|
| 11 |
followed by the template argument list
|
| 12 |
[[temp.decls.general]], [[temp.arg.general]] of the class template
|
|
@@ -90,26 +90,26 @@ template<class T> class X {
|
|
| 90 |
};
|
| 91 |
```
|
| 92 |
|
| 93 |
— *end example*]
|
| 94 |
|
| 95 |
-
The name of a
|
| 96 |
-
declaration whose locus is contained by the scope to which the
|
| 97 |
-
|
| 98 |
|
| 99 |
[*Example 5*:
|
| 100 |
|
| 101 |
``` cpp
|
| 102 |
template<class T, int i> class Y {
|
| 103 |
-
int T; // error: template
|
| 104 |
void f() {
|
| 105 |
-
char T; // error: template
|
| 106 |
}
|
| 107 |
friend void T(); // OK, no name bound
|
| 108 |
};
|
| 109 |
|
| 110 |
-
template<class X> class X; // error: hidden by template
|
| 111 |
```
|
| 112 |
|
| 113 |
— *end example*]
|
| 114 |
|
| 115 |
Unqualified name lookup considers the template parameter scope of a
|
|
|
|
| 1 |
### Locally declared names <a id="temp.local">[[temp.local]]</a>
|
| 2 |
|
| 3 |
Like normal (non-template) classes, class templates have an
|
| 4 |
injected-class-name [[class.pre]]. The injected-class-name can be used
|
| 5 |
as a *template-name* or a *type-name*. When it is used with a
|
| 6 |
+
*template-argument-list*, as a *template-argument* for a type template
|
| 7 |
+
template parameter, or as the final identifier in the
|
| 8 |
*elaborated-type-specifier* of a friend class template declaration, it
|
| 9 |
is a *template-name* that refers to the class template itself.
|
| 10 |
Otherwise, it is a *type-name* equivalent to the *template-name*
|
| 11 |
followed by the template argument list
|
| 12 |
[[temp.decls.general]], [[temp.arg.general]] of the class template
|
|
|
|
| 90 |
};
|
| 91 |
```
|
| 92 |
|
| 93 |
— *end example*]
|
| 94 |
|
| 95 |
+
The name of a template parameter shall not be bound to any following
|
| 96 |
+
declaration whose locus is contained by the scope to which the template
|
| 97 |
+
parameter belongs.
|
| 98 |
|
| 99 |
[*Example 5*:
|
| 100 |
|
| 101 |
``` cpp
|
| 102 |
template<class T, int i> class Y {
|
| 103 |
+
int T; // error: template parameter hidden
|
| 104 |
void f() {
|
| 105 |
+
char T; // error: template parameter hidden
|
| 106 |
}
|
| 107 |
friend void T(); // OK, no name bound
|
| 108 |
};
|
| 109 |
|
| 110 |
+
template<class X> class X; // error: hidden by template parameter
|
| 111 |
```
|
| 112 |
|
| 113 |
— *end example*]
|
| 114 |
|
| 115 |
Unqualified name lookup considers the template parameter scope of a
|