OKlibrary  0.2.1.6
OKlib::SetAlgorithms::MapValue< Map > Class Template Reference

Adaptor to create a functor from a map in the sense of the C++ standard. More...

#include <BasicMapOperations.hpp>

Inheritance diagram for OKlib::SetAlgorithms::MapValue< Map >:
unary_function

List of all members.

Public Member Functions

 MapValue (const Map &map)
const value_type & operator() (const key_type &x) const

Detailed Description

template<class Map>
class OKlib::SetAlgorithms::MapValue< Map >

Adaptor to create a functor from a map in the sense of the C++ standard.

Given an object m of type Map, via MapValue<Map>(m) we obtain a functor, that is, a function object which maps objects from the Map-key-type to the Map-value-type. The associated helper-function is map_value. Everything is handled by (const) reference.

Todo:
There should also exist another version which returns the function value as a copy.
Todo:
Via an error-policy there should be the possibility to throw an exception in case of an argument not in the domain.

Definition at line 39 of file BasicMapOperations.hpp.


Constructor & Destructor Documentation

template<class Map>
OKlib::SetAlgorithms::MapValue< Map >::MapValue ( const Map &  map) [inline]

Definition at line 40 of file BasicMapOperations.hpp.


Member Function Documentation

template<class Map>
const value_type& OKlib::SetAlgorithms::MapValue< Map >::operator() ( const key_type &  x) const [inline]

Definition at line 46 of file BasicMapOperations.hpp.


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