Re: "Function template" problem
From: Markus Moll (moll_at_rbg.informatik.tu-darmstadt.de)
Date: 09/30/04
- Next message: Siemel Naran: "Re: Implementing a templated "round" function?"
- Previous message: boki: "USB hot-plug detection"
- In reply to: Lionel B: ""Function template" problem"
- Next in thread: Lionel B: "Re: "Function template" problem"
- Reply: Lionel B: "Re: "Function template" problem"
- Reply: Gernot Frisch: "Re: "Function template" problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Sep 2004 10:51:21 +0200
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>();
}
Markus
- Next message: Siemel Naran: "Re: Implementing a templated "round" function?"
- Previous message: boki: "USB hot-plug detection"
- In reply to: Lionel B: ""Function template" problem"
- Next in thread: Lionel B: "Re: "Function template" problem"
- Reply: Lionel B: "Re: "Function template" problem"
- Reply: Gernot Frisch: "Re: "Function template" problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|