Invoking templated member of templated class from within a templated function, with explicit parameter

67 views Asked by At
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 sees < as the less-than operator in line A but not in line B.

Is there some kind of "relaxed-mode" in which GCC can handle line A as MSVC does, so that I don't have to write m.template f<1>(1)?

0

There are 0 answers