OON: Re: oon-digest V1 #38

From: Michael W. Buksas (mwbuksas@cnls.lanl.gov)
Date: Fri Mar 26 1999 - 18:05:57 EST


> From: Gabriel Dos Reis <Gabriel.Dos-Reis@dptmaths.ens-cachan.fr>
> Date: 25 Mar 1999 15:28:25 +0100
> Subject: Re: OON: integration, finding roots - design question
> ...

Gabriel, or anybody,

Could you elaborate on the use of the function_trait class here?

> template<typename T, typename Function>
> typename function_trait<Function>::value_type
> integrate(const T& start, const T& end, const Function& func)
> { /* ... */ }

It's the second line which is confusing to me. I understand that it
is using a trait class to define the return type of the integrate
function, but where is the class function_trait defined? Is this a
built in part of a library (such as the STL)? Or, would the implementor
of the integrate function also write this trait class, and provide
template specializations for the desired function types?

I hope nobody minds what is probably an elementary question, but this
technique would be of great help to me too.

Thanks,
Mike

--
Michael Buksas    CNLS, Los Alamos National Laboratory   505/667-9956



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:08 EST