jac*_*k X 6 c++ language-lawyer c++20
考虑 [temp.dep.type] p3 之后的示例
\ntemplate<class T> struct A {\n typedef int M;\n struct B {\n typedef void M;\n struct C;\n };\n};\n\ntemplate<class T> struct A<T>::B::C : A<T> {\n M m; // OK, A<T>\xe2\x80\x8b::\xe2\x80\x8bM\n};\nRun Code Online (Sandbox Code Playgroud)\n该示例暗示 A 是 A::B::C 定义中的当前实例化类。然而,根据 [temp.dep.type#1.2]
\n\n\n名称或模板 ID 指的是当前实例化,如果它是
\n\n\n\n
\n- [...]
\n- 在主类模板或主类模板成员的定义中,类模板的名称,后跟其模板头的模板参数列表([temp.arg]),包含在 <> 中(或等效模板)别名专业化),
\n- [...]
\n
在这个例子中主类模板是A,那么C嵌套类的成员类B是类模板的成员吗A?