Re: "Function template" problem

google_at_lionelb.com
Date: 09/30/04


Date: 30 Sep 2004 01:43:07 -0700

Gernot Frisch wrote:
> "Lionel B" <google@lionelb.com> schrieb im Newsbeitrag
> news:e1308e8b.0409292355.34df10ed@posting.google.com...
> > Greetings,
> >
> > I cannot figure out why the following code does not compile:
> >
> > --- BEGIN CODE ---
> >
> > typedef double ftype(double);
>
> what you do is:
> template <double f> double func(f x);
> But: You don't want to give the type of the template argument, since
> it's a "template".
> So, use
>
> template<class C> double fkt(C argC);

Apologies if I'm being obtuse, but I don't understand this reply at all
:(

-- 
Lionel B


Relevant Pages

  • Re: unresolved external symbol
    ... "Gernot Frisch" wrote in message ... > gives a unresolved external symbol: ... > header, but it's really lenghty. ... template function in the header (or have at least some source ...
    (comp.lang.cpp)
  • Re: "Function template" problem
    ... schrieb im Newsbeitrag ... > Gernot Frisch wrote: ... > Apologies if I'm being obtuse, but I don't understand this reply at ...
    (comp.lang.cpp)
  • Re: "Function template" problem
    ... >> Apologies if I'm being obtuse, but I don't understand this reply at ... I am implementing Todd Veldhuizen's "Pointer-to-function as a template ... arose when trying to build a template class with a ... function that calls the member template function ...
    (comp.lang.cpp)
  • Re: VC6 compiling problem
    ... > Gernot Frisch wrote: ... the problem is VC++ 6 is notoriously bad with template ... It relies on the normal function arg decoration ... to disambiguate instances of the same template. ...
    (comp.lang.cpp)