Re: "Function template" problem

From: Markus Moll (moll_at_rbg.informatik.tu-darmstadt.de)
Date: 09/30/04


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



Relevant Pages

  • Re: Error a: _mayn.c:12 illegal return type, found int expected void
    ... > a given compiler writer allows or forbids is ... The error message I recieved was in plain english ... >Do you, Jacob, perhaps have a belief that all C programers ... the purpose of lint is to provide error messages. ...
    (comp.compilers.lcc)
  • understanding segmentation faults
    ... Is "segmentation fault" an error message that is issued by the operating ... not a problem that the compiler vendors can easily solve. ... technical terminology an "array section"?). ...
    (comp.lang.fortran)
  • Re: xPC target w/ Matlab 2009a - unable to build model
    ... The error message makes me believe that there is some compiler environment/path issue on the PC you are working on. ... When you do a mex -setup are you able to see the Watcom 1.7 compiler? ... Setting environment for using Microsoft Visual Studio 2008 ...
    (comp.soft-sys.matlab)
  • Re: operator function
    ... >> of them have anything to do with what the error message seems ... Setting (int h, int m, int s, int TT) ... Now the compiler knows, that it is safe to use that function on a const ... >> operator returns a Setting object. ...
    (alt.comp.lang.learn.c-cpp)
  • c89 problem w/ irrhfsu
    ... i've got a lot of experience setting up and configuring OMVS but not ... by means of the c89 compiler, inside the OMVS environment, (this is ... and i received the following error message: ...
    (bit.listserv.ibm-main)