FunctorToMap

Declared in lemon/maps.h, in the group Map Adaptors; the same class on the Doxygen site.

template< typename F , typename K = typename F::argument_type , typename V = typename F::result_type >
class FunctorToMap : public MapBase< typename F::argument_type , typename F::result_type >

Converts an STL style (unary) functor to a map.

This read-only map returns the value of a given functor. Actually, it just wraps the functor and provides the Key and Value typedefs.

Template parameters K and V will become its Key and Value. In most cases they have to be given explicitly because a functor typically does not provide argument_type and result_type typedefs. Parameter F is the type of the used functor.

The simplest way of using this map is through the functorToMap() function.

See also

MapToFunctor

Public Types

typedef K Key

typedef V Value

Public Functions

inline FunctorToMap( const F & f = F() )

Constructor.

inline Value operator[]( const Key & k ) const