4.28. kink/container/FLAT_MAP¶
Provides an ordered_map implementation which stores all key-val pairs in a flat sorted vecs.
This map implementation is intended to be used when the size of the map is limited to a small number, or new keys are rerely inserted after initially constructed.
4.28.1. FLAT_MAP.of(K0 V0 K1 V1 ,,,)¶
Makes a flat ordered_map with the given keys and vals, with the natural ordering.
In the natural ordering, X precedes Y if and only if X < Y.
4.28.2. FLAT_MAP.from_pairs(Pair_eacher)¶
`from_pairs` makes a flat ordered_map with the given pairs, with the natural ordering.
In the natural ordering, X precedes Y if and only if X < Y.
Precondition:
• `Pair_eacher` must be a sequence which support .each($consume) method. `each` method must call $consume for each pair of a key and the corresponding val.
4.28.3. FLAT_MAP.new(...[$config_fun={}])¶
Makes an empty ordered_map of the flat map implementation.
$config_fun takes a Config as an arg. Config has the following method.
Config.precede_fun($_precede?): sets $_precede? to be used to determine the strict weak ordering of keys. $_precede? must take two parameters, and returns true if the first parameter precedes the second one in the ordering, or false otherwise.
If Config.precede_fun is not called, the map uses the natural ordering.