I'm trying to compile the following code:
struct A {
template<int N> static void a() {}
};
template<> void A::a<5>() {}
template<class T>
struct B {
static void b() {
T::a<5>();
}
};
void test() {
A::a<5>();
B<A>::b();
}
and compiler interprets <
in T::a<5>
as an operator <
, resulting in error:
invalid operands of types ‘<unresolved overloaded function type>’ and ‘int’ to binary ‘operator<’
Is there any way to explicitly instantiate T::a<5>
without compiler errors?
Thank you.
gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)