Trie

Trie-based dictionary (associative array) that can use any type as a key. No hash functions are required.

Constructors

this
this()
Undocumented in source.
this
this(ubyte s)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

clear
void clear()

Remove all elements.

free
void free()

Trie must be manually freed when it's no longer needed.

get
T* get(K k)

Get value by key. Returns null if the element does not exist in trie.

opApply
int opApply(int delegate(K, ref T) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinaryRight
T* opBinaryRight(K k)
opIndex
T opIndex(K k)

Get value by key. It's an error to access non-existing key.

opIndexAssign
T opIndexAssign(T v, K k)

Set value by key

remove
void remove(K k)

Remove element by key.

set
void set(K k, T v)

Set value by key.

Variables

active
bool active;
Undocumented in source.
children
Array!(Trie!(T, K)) children;
Undocumented in source.
key
K key;
Undocumented in source.
length
size_t length;
Undocumented in source.
symbol
ubyte symbol;
Undocumented in source.
value
T value;
Undocumented in source.

Meta