bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Template function calling a templated function in the templated clas


From: Charles Karney
Subject: Re: Template function calling a templated function in the templated class
Date: Mon, 09 Oct 2006 13:39:08 -0400
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)

Thomas Maeder wrote:
> "Charles Karney" <address@hidden> writes:
> 
> 
>>  class bar {
>>  public:
>>    template<class X> int barf(X x) { return x.foof0<double>(); }
> 
> 
> foof0 is a dependent name naming a member template; such names have to
> prefixed with the keyword template:
> 
> template<class X>
> int barf(X x)
> {
>   return x.template foof0<double>();
> }

Thanks!  I should have figured that out myself...

-- 
Charles Karney <address@hidden>
Sarnoff Corporation, Princeton, NJ 08543-5300

URL: http://charles.karney.info
Tel: +1 609 734 2312
Fax: +1 609 734 2662




reply via email to

[Prev in Thread] Current Thread [Next in Thread]