回答編集履歴
1
injected-class-name
answer
CHANGED
@@ -3,7 +3,9 @@
|
|
3
3
|
[C++11(N3337)](https://timsong-cpp.github.io/cppwp/n3337)より
|
4
4
|
|
5
5
|
> [[class] 2](https://timsong-cpp.github.io/cppwp/n3337/class#2)
|
6
|
-
> A __class-name__ is inserted into the scope in which it is declared immediately after the __class-name__ is seen. The __class-name__ is also inserted into the scope of the class itself; this is known as the injected-class-name. For purposes of access checking, the __injected-class-name__ is treated as if it were a public member name. A __class-specifier__ is commonly referred to as a class definition. A class is considered defined after the closing brace of its __class-specifier__ has been seen even though its member functions are in general not yet defined. The optional __attribute-specifier-seq__ appertains to the class; the attributes in the __attribute-specifier-seq__ are thereafter considered attributes of the class whenever it is named.
|
6
|
+
> A __class-name__ is inserted into the scope in which it is declared immediately after the __class-name__ is seen. **The __class-name__ is also inserted into the scope of the class itself; this is known as the injected-class-name.** For purposes of access checking, the __injected-class-name__ is treated as if it were a public member name. A __class-specifier__ is commonly referred to as a class definition. A class is considered defined after the closing brace of its __class-specifier__ has been seen even though its member functions are in general not yet defined. The optional __attribute-specifier-seq__ appertains to the class; the attributes in the __attribute-specifier-seq__ are thereafter considered attributes of the class whenever it is named.
|
7
7
|
|
8
8
|
> [[temp.local] 1](https://timsong-cpp.github.io/cppwp/n3337/temp.local#1)
|
9
|
-
> Like normal (non-template) classes, class templates have an injected-class-name (Clause [class]). The injected-class-name can be used as a __template-name__ or a __type-name__. When it is used with a __template-argument-list__, as a __template-argument__ for a template __template-parameter__, or as the final identifier in the __elaborated-type-specifier__ of a friend class template declaration, it refers to the class template itself. Otherwise, it is equivalent to the __template-name__ followed by the __template-parameters__ of the class template enclosed in <>.
|
9
|
+
> **Like normal (non-template) classes, class templates have an injected-class-name (Clause [class]). The injected-class-name** can be used as a __template-name__ or a __type-name__. When it is used with a __template-argument-list__, as a __template-argument__ for a template __template-parameter__, or as the final identifier in the __elaborated-type-specifier__ of a friend class template declaration, **it refers to the class template itself**. Otherwise, it is equivalent to the __template-name__ followed by the __template-parameters__ of the class template enclosed in <>.
|
10
|
+
|
11
|
+
つまり`injected-class-name`になるから使える理論。
|