Using template parameters as template parameters

Posted by pythonic metaphor on Stack Overflow See other posts from Stack Overflow or by pythonic metaphor
Published on 2010-06-10T15:40:46Z Indexed on 2010/06/10 15:42 UTC
Read the original article Hit count: 602

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 it "expected primary-expression before '>' token", i.e. that "S" wasn't a valid primary-expression.

© Stack Overflow or respective owner

Related posts about c++

Related posts about templates