Subscript operator [ ] of maps.
MapValue mapValue(map, key)
Include Headers
A map.
Types: Map
A key.
Metafunctions: Key
Usually, value implements the subscript operator [ ], but for maps, this operator is implemented in mapValue. The semantic of this operator depends on the kind of map: If the map has a cargo, than mapValue(map, key) returns the cargo of the (first) value in the map of the given key. If the map has no cargo, than the function returns a true, if key is in map, or false otherwise.
You may overload key and cargo for your own value type in order to define, what part of your value type is used as key and what as cargo.
Note: There is no way to create a set of Pair, since it is always interpreted as a key/value pair. If you need a key type that holds two members, define your own key type.
Return Values
If map is a set: The same as hasKey(map, key).
If map is a dictionary: The same as value(map, key).
Metafunctions: MapValue
See Also
SeqAn - Sequence Analysis Library -

Page built @2011/02/08 21:37:06