Hi there,

  Why do I need the template keyword in this case:

template <typename T1>
struct A
{
  template <typename T2>
  void foo() {}
};

template <typename T1>
struct B
{
  template <typename T2>
  void bar() {
    A<T1> a;
    // a.foo<T2>(); // does not compile with gcc
    a.template foo<T2>();
  }
};

int main()
{
  B<int> b;
  return 0;
}

Thanks,
-Mathieu

_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to