Why is the following code invalid?
template <typename S, typename T> struct B{ void f(T t, S s) {t.f<S>(s); } };
gcc 4.3.4 complains that this is the "expected primary expression before"> the token, i.e. that "S" is not a valid base expression.
You need to specify what fis the pattern:
f
void f(T t, S s) { t.template f<S>(s); }
++ ( ), f s T. , : < , ? ++ , , f , ++ , T.
T
<
, , . "tf (s)", : , , , f , , f, S.