template<int N>
struct foo {
template<int M>
void f(int i){}
};
template<int N>
void bar() {
foo<N> m;
m.f<1>(1); // line A
}
int main(){
bar<1>();
foo<1> n;
n.f<1>(1); // line B
return 0;
}
GCC在行A中将<
视为 less-than 运算符,但不在行B中。
是否存在某种“宽松模式”,其中GCC可以像MSVC一样处理A行,这样我就不必写m.template f<1>(1)
了?