RBTree.remove

Removes elements from the container that are equal to the given values according to the less comparator. One element is removed for each value given which is in the container. If allowDuplicates is true, duplicates are removed only if duplicate values are given.

  1. size_t remove(U elems)
  2. size_t remove(U[] elems)
    struct RBTree(T, alias less = "a < b", bool allowDuplicates = true, ALLOC = ThreadMem, bool NOGC_ = false)
    size_t
    remove
    (
    U
    )
    (
    U[] elems
    )
    if (
    is(typeof(binaryFun!less(T.init, T.init)))
    )
  3. size_t remove(Stuff stuff)

Return Value

Type: size_t

The number of elements removed.

Complexity: O(m log(n)) (where m is the number of elements to remove)

Examples

auto rbt = redBlackTree!true(0, 1, 1, 1, 4, 5, 7);
rbt.removeKey(1, 4, 7);
assert(equal(rbt[], [0, 1, 1, 5]));
rbt.removeKey(1, 1, 0);
assert(equal(rbt[], [5]));

Meta