Bucket.add

Adds a bucket element with key as key.

The element is inserted as the first bucket element.

  1. Element* add(Element.Key key, Element* new_element)
    struct Bucket(size_t V, K = hash_t)
    add
    out (element) { assert (element !is null); }
  2. Element* add(Element* element)

Parameters

key Element.Key

key for the new element

new_element Element*

expression returning a new element, evaluated exactly once, if the key to be added does not already exist in the bucket

Return Value

Type: Element*

pointer to inserted element

Out: The returned pointer is never null.

Meta