4.28. kink/container/FLAT_SET

Provides an ordered_set implementation which stores all the elements in a sorted vec.

This set implementation is intended to be used when the size of the set is limited to a small number, or new elements are rarely inserted after initially constructed.

Worst-case computational orders of each operations are as follows:

have?: Θ(log N)

push: Θ(N)

remove: Θ(N)

size and empty?: Θ(1)

Where N is the size of the set.

4.28.1. FLAT_SET.of(...Elems)

Makes a flat set with the natural ordering, containing Elems.

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

4.28.2. FLAT_SET.from_each(Eacher)

`from_each` makes a flat set with the natural ordering, containing each element of the `Eacher`.

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

4.28.3. FLAT_SET.new(...[$config_fun = {}])

Makes an empty ordered_set with the flat set implementation.

$config_fun must take a Config as a param. The Config val has the following method.

Config.precede_fun($_precede?): sets $_precede? to be used to determine the strict weak ordering of elems. $_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 natural ordering is used.