This read-only map takes two maps and a binary functor and returns the combination of the two given maps using the functor. That is to say, if m1
is of type M1
and m2
is of M2
and f
is of F
, then for
cm[x]
will be equal to f(m1[x],m2[x])
.
The Key
type of the map is inherited from M1
(M1::Key
must be convertible to M2::Key
) and the Value
type is V
. M2::Value
and M1::Value
must be convertible to the corresponding input parameter of F
and the return type of F
must be convertible to V
.
The simplest way of using this map is through the combineMap() function.
#include <lemon/maps.h>
Public Types | |
typedef M1::Key | Key |
| |
typedef V | Value |
| |
Public Types inherited from MapBase< M1::Key, V > | |
typedef M1::Key | Key |
The key type of the map. | |
typedef V | Value |
The value type of the map. (The type of objects associated with the keys). | |
Public Member Functions | |
CombineMap (const M1 &m1, const M2 &m2, const F &f=F()) | |
Constructor. | |
Value | operator[] (const Key &k) const |
| |
Related Functions | |
(Note that these are not member functions.) | |
template<typename M1 , typename M2 , typename F , typename V > | |
CombineMap< M1, M2, F, V > | combineMap (const M1 &m1, const M2 &m2, const F &f) |
Returns a CombineMap class. | |