Set.insert

Undocumented in source. Be warned that the author may not have intended to support it.
  1. size_t insert(T value)
  2. size_t insert(T value)
    struct Set(T, alias hasher = hash)
    size_t
    insert
    ()
    ()
    if (
    isHashFunction!(hasher, T)
    )
  3. size_t insert(R range)

Examples

Set!int set;
assert(8 !in set);

assert(set.insert(8) == 1);
assert(set.length == 1);
assert(8 in set);

assert(set.insert(8) == 0);
assert(set.length == 1);
assert(8 in set);

assert(set.remove(8));
assert(set.insert(8) == 1);

Meta