Re: "Function template" problem
From: Lionel B (google_at_lionelb.com)
Date: 09/30/04
- Next message: Jef Driesen: "Re: Implementing a templated "round" function?"
- Previous message: Computer Whizz: "Re: Best compiler out there?"
- In reply to: Markus Moll: "Re: "Function template" problem"
- Next in thread: Gernot Frisch: "Re: "Function template" problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Jef Driesen: "Re: Implementing a templated "round" function?"
- Previous message: Computer Whizz: "Re: Best compiler out there?"
- In reply to: Markus Moll: "Re: "Function template" problem"
- Next in thread: Gernot Frisch: "Re: "Function template" problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|