This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
template syntax
- From: Marco Correia <mvc at netcabo dot pt>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 22 Jul 2004 18:00:30 +0000
- Subject: 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>