Re: template function in template class

2007-10-28 Thread Jeff Schwab
On Oct 27, 3:06 pm, mathieu <[EMAIL PROTECTED]> wrote: > Hi there, > > Why do I need the template keyword in this case: > > template > struct A > { > template > void foo() {} > > }; > > template > struct B > { > template > void bar() { > A a; > // a.foo(); // does not compile

template function in template class

2007-10-27 Thread mathieu
Hi there, Why do I need the template keyword in this case: template struct A { template void foo() {} }; template struct B { template void bar() { A a; // a.foo(); // does not compile with gcc a.template foo(); } }; int main() { B b; return 0; } Thanks, -Mathieu