Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

AbsMap Class Template Reference
[Map Adaptors]

#include <lemon/maps.h>

List of all members.


Detailed Description

template<class M>
class lemon::AbsMap< M >

This read only map returns the absolute value of the value returned by the given map. Its Key and Value will be inherited from M. Value must be comparable to 0 and the unary - operator must be defined for it, of course.

Bug:
We need a unified way to handle the situation below:
       struct _UnConvertible {};
       template<class A> inline A t_abs(A a) {return _UnConvertible();}
       template<> inline int t_abs<>(int n) {return abs(n);}
       template<> inline long int t_abs<>(long int n) {return labs(n);}
       template<> inline long long int t_abs<>(long long int n) {return ::llabs(n);}
       template<> inline float t_abs<>(float n) {return fabsf(n);}
       template<> inline double t_abs<>(double n) {return fabs(n);}
       template<> inline long double t_abs<>(long double n) {return fabsl(n);}


Public Types

typedef M::Key Key
 
typedef M::Value Value
 

Public Member Functions

 AbsMap (const M &_m)
 Constructor.

Related Functions

(Note that these are not member functions.)

AbsMap< M > absMap (const M &m)
 Returns a AbsMap class.


The documentation for this class was generated from the following file:
Generated on Sat Aug 27 14:16:08 2005 for LEMON by  doxygen 1.4.4