This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

template syntax


hi,

Could anyone please tell me why this code:

template<class T> 
class B 
{
public:
    template<class T2>
    void method(int i) {cout << typeid(T2).name() << endl;}
};


template<class T1>
void bla() 
{
    B<T1> v;
    v.method<int>(3);			// <-- HERE (line 20)
    v.B<T1>::method<int>(3);	// <-- Also doesn't work
}

gives me a parse error:

main.cpp: In function `void bla()':
main.cpp:20: error: parse error before `>' token

marco@debussy tmp $ g++ --version
g++ (GCC) 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)

Thanks!
PS: Please CC me since I'm not subscribed.
-- 
Marco Correia <mvc@netcabo.pt>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]