ForkMap

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

template< typename M1 , typename M2 >
class ForkMap : public MapBase< M1::Key , M1::Value >

Applies all map setting operations to two maps.

This map has two writable map parameters and each write request will be passed to both of them. If M1 is also readable, then the read operations will return the corresponding values of M1.

The Key and Value types are inherited from M1. The Key and Value of M2 must be convertible from those of M1.

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

Public Types

typedef M1::Key Key

typedef M1::Value Value

Public Functions

inline ForkMap( M1 & m1 , M2 & m2 )

Constructor.

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

Returns the value associated with the given key in the first map.

inline void set( const Key & k , const Value & v )

Sets the value associated with the given key in both maps.