An Associative Sequence allows efficient retrieval of elements based on
keys. Like associative sequences in MPL,
and unlike associative containers in STL,
Fusion associative sequences have no implied ordering relation. Instead,
type identity is used to impose an equivalence relation on keys, and the
order in which sequence elements are traversed during iteration is left
unspecified. In addition, unlike STL,
Associative Sequences have mutable iterators. This is due to the fact that
there is no associated ordering relation and the runtime value of the keys
themselves do not have any effect on the associativity of the sequence.
Notation
s
-
An Associative Sequence
S
-
An Associative Sequence type
K
-
An arbitrary key type
o
-
An arbitrary object
e
-
A Sequence element
For any Associative Sequence the following expressions must be valid:
result_of::at_key
<S, K>
returns the actual type returned by
at_key
<K>(s)
. In
most cases, this is a reference. Hence, there is no way to know the exact
element type using result_of::at_key
<S, K>
.The element at K
may actually be a reference to begin with. For this purpose, you can use
result_of::value_at_key
<S, N>
.