this->a.foo<Y>(); erzeught Fehler
-
Hallo!
Folgender Quelltext:
class A { template <class X> void foo(X x = 0) const { } }; template <class Y> class B { A a; void bar(Y y) { this->a.foo<Y>(); } };erzeugt beim kompilieren die folgenden Fehler:
test.cpp: In member function ‘void B<Y>::bar(Y)’: test.cpp:15: error: expected primary-expression before ‘>’ token test.cpp:15: error: expected primary-expression before ‘)’ tokenWarum?
Warum funktioniert es, wenn ich dasthis->weglasse?
-
Welcher Compiler?
-
gcc 4.1
-
14.2§4
this->a.template foo<Y>();