This readable map assigns a specified value to each key.
In other aspects it is equivalent to NullMap. So it conforms to the ReadWriteMap concept, but it absorbs the data written to it.
The simplest way of using this map is through the constMap() function.
#include <lemon/maps.h>
Inheritance diagram for ConstMap< K, V >:Public Types | |
| typedef K | Key |
| | |
| typedef V | Value |
| | |
Public Types inherited from MapBase< K, V > | |
| typedef K | 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 | |
| ConstMap () | |
| Default constructor. More... | |
| ConstMap (const Value &v) | |
| Constructor with specified initial value. More... | |
| Value | operator[] (const Key &) const |
| Gives back the specified value. | |
| void | set (const Key &, const Value &) |
| Absorbs the value. | |
| void | setAll (const Value &v) |
| Sets the value that is assigned to each key. | |
Related Functions | |
(Note that these are not member functions.) | |
| template<typename K , typename V > | |
| ConstMap< K, V > | constMap (const V &v) |
Returns a ConstMap class. More... | |
| template<typename K , typename V , V v> | |
| ConstMap< K, Const< V, v > > | constMap () |
Returns a ConstMap class with inlined constant value. More... | |
|
inline |
Default constructor. The value of the map will be default constructed.
1.8.5