3.26. kink/container/FLAT_MAP

3.26.1. 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.

3.26.2. 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.

3.26.3. FLAT_MAP.of_each_pair(Pair_eacher)

Makes a flat ordered_map with the given pairs, with the natural ordering.

The Pair_eacher must support .each($consume). The each method must call $consume for each pair of a key and the corrensponding val.

In the natural ordering, X precedes Y if and only if X < Y.

3.26.4. FLAT_MAP.new([[$config = {}]])

Makes an empty ordered_map of the flat map implementation.

$config takes a Conf as an arg. Conf has the following method.

Conf.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 Conf.precede_fun is not called, the map uses the natural ordering.