没有this要出错

template<typename>
struct B { int x; };

template<typename T>
struct X : B<T> {
void foo() { this->x = 0; }
// this是依赖型名称
};
posted @ 2020-05-25 16:57  zjh6  阅读(10)  评论(0)    收藏  举报  来源