Re: "Function template" problem

From: Lionel B (google_at_lionelb.com)
Date: 09/30/04


Date: 30 Sep 2004 03:01:30 -0700

Markus Moll wrote:
> Hi
>
> Lionel B wrote:
>
> > double foo()
> > {
> > return a.eval<F>();
> > }
> > };
> >
> > --- END CODE ---
> >
> > It generates the error message:
> > scratch.cpp: In member function `double B<F>::foo()':
> > scratch.cpp:23: error: parse error before `;' token
>
> This is one of the rare cases where you need to tell the compiler
that the
> name eval is a member template (it's a dependent name), otherwise the
'<'
> is considered "less than".
>
> double foo()
> {
> return a.template eval<F>();
> }

Wow, I wouldn't have got that in a million years... never seen that
syntax before.

Many thanks,

-- 
Lionel B


Relevant Pages

  • Re: Multiple forenames
    ... Not unique, but certainly rare. ... desperate, since they used Yetty. ... first son's names spelled out Lionel and another ... Then there are the football mad fathers who name a child after all the ...
    (soc.genealogy.britain)
  • Re: "Function template" problem
    ... Lionel B wrote: ... > It generates the error message: ... This is one of the rare cases where you need to tell the compiler that the ...
    (comp.lang.cpp)