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
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