BucketSet.get_

Looks up a mapping from the specified key.

class BucketSet(size_t V, K = hash_t)
protected final
get_
(
in K key
,
bool must_exist = false
)
out (element) { version (none) { if (element) { assert (element.key == key, "key mismatch"); } else { assert (!must_exist, "element not found"); } } }

Parameters

key K

key to look up mapping for

must_exist bool

true: verify that the mapping exists, false: the mapping may or may not exist

Return Value

Type: Bucket.Element*

a pointer to the element mapped to by the specified key or null if not found and must_exist is false. The caller should make sure that the key is not changed.

Out: - The returned array can only be null if must_exist is false. - The length of the returned array is V unless the array is null.

Meta