$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Template method applied to template object
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-03-03 13:02:46
AMDG
Adrien Chauve wrote:
> The following lines don't compile with g++ (4.3.2) whereas it's ok
> with msvc 9.
>
> struct OtherFoo
> {
> template<class T>
> void f(const T& t)
> {
> t.foo<double>();
> }
> };
>
> The ouput is :
> test.cpp: In member function void OtherFoo::f(const T&):
> test.cpp:17: erreur: expected primary-expression before double
> test.cpp:17: erreur: expected `;' before double
>
>
> Does anybody know a workaround ?
t.template foo<double>();
This is required by the standard. msvc is being lax.
In Christ,
Steven Watanabe