HashMap.add

Add a new element to the set. Does not add if there is an equivalent already present. Returns true where an element is added, false where it already exists (and was possibly updated).

Time complexity: O(1) average; O(n) worst.

  1. bool add(K key, V element)
    class HashMap(K, V, alias Hash = Container.hash, alias Reap = Container.reap, alias Heap = Container.DefaultCollect)
    final
    bool
    add
    (
    K key
    ,)
  2. bool add(K key, V element, K function(K) retain)

Meta