dlr::numeric::NumericTypeConversionFunctor< TypeIn, TypeOut > Struct Template Reference

Functor template which uses static_cast to convert instances of one type into instances of another, but does the right thing with regard to rounding, so that the difference between the input and the returned value is minimized. More...

#include <functional.h>

List of all members.

Public Member Functions

TypeOut operator() (const TypeIn &input)
 This operator returns the output value which minimizes the difference between input and output.


Detailed Description

template<class TypeIn, class TypeOut>
struct dlr::numeric::NumericTypeConversionFunctor< TypeIn, TypeOut >

Functor template which uses static_cast to convert instances of one type into instances of another, but does the right thing with regard to rounding, so that the difference between the input and the returned value is minimized.

Definition at line 91 of file functional.h.


Member Function Documentation

template<class TypeIn, class TypeOut>
TypeOut dlr::numeric::NumericTypeConversionFunctor< TypeIn, TypeOut >::operator() ( const TypeIn &  input  )  [inline]

This operator returns the output value which minimizes the difference between input and output.

In general, this takes some smarts, so the default case is not implemented.

Parameters:
input Will be converted to type TypeOut.
Returns:
The result of the conversion.

Definition at line 103 of file functional.h.


The documentation for this struct was generated from the following file:

Generated on Tue Jan 6 17:52:08 2009 for dlrUtilities Utility Library by  doxygen 1.5.6