回答編集履歴

1

injected-class-name

2019/08/01 01:09

投稿

yumetodo
yumetodo

スコア5852

test CHANGED
@@ -8,10 +8,14 @@
8
8
 
9
9
  > [[class] 2](https://timsong-cpp.github.io/cppwp/n3337/class#2)
10
10
 
11
- > 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.
11
+ > 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.
12
12
 
13
13
 
14
14
 
15
15
  > [[temp.local] 1](https://timsong-cpp.github.io/cppwp/n3337/temp.local#1)
16
16
 
17
- > 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 <>.
17
+ > **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 <>.
18
+
19
+
20
+
21
+ つまり`injected-class-name`になるから使える理論。