Possible Duplicate:
C++ template member function of template class called from template function
template<class T1>
class A
{
public:
template<class T0>
void foo() const {}
};
template<class T0,class T1>
void bar( const A<T1>& b )
{
b.foo<T0>(); // This throws " expected primary-expression before ‘>’ token"
}
I can change it to
b->A<T1>::template foo<T0>();
which compiles fine. However I can also change it to
b.A<T1>::template foo<T0>();
which compiles fine too. eh?
How does one correctly call the template member function in the sense of the original code?