nulib.collections.map

Associative Arrays

This module implements BTree-backed associative arrays. @nogc associative array, replacement for std::map.

Members

Aliases

map
alias map(Key, Value) = MapImpl!(Key, Value, (a, b) => a < b, false, true)

An associative container which contains key-value pairs.

multimap
alias multimap(Key, Value) = MapImpl!(Key, Value, (a, b) => a < b, true, true)

An associative container which contains key-value pairs.

weak_map
alias weak_map(Key, Value) = MapImpl!(Key, Value, (a, b) => a < b, false, false)

An associative container which contains key-value pairs.

weak_multimap
alias weak_multimap(Key, Value) = MapImpl!(Key, Value, (a, b) => a < b, true, false)

An associative container which contains key-value pairs.

Structs

MapImpl
struct MapImpl(K, V, alias less = KeyCompareDefault!Key, bool allowDuplicates = false, bool ownsMemory = false)

Tree-map, designed to replace std::map usage. The API should looks closely like the builtin associative arrays. O(log(n)) insertion, removal, and search time.

Meta

Authors

Steven Schveighoffer, Andrei Alexandrescu, Guillaume Piolat, Luna Nielsen