Set.remove

Removes an element.

struct Set(T, alias hasher = hash)
size_t
remove
()
if (
isHashFunction!(hasher, T)
)

Parameters

value T

Element value.

Return Value

Type: size_t

Number of elements removed, which is in the container with unique values 1 if an element existed, and 0 otherwise.

Examples

Set!int set;
set.insert(8);

assert(8 in set);
assert(set.remove(8) == 1);
assert(set.remove(8) == 0);
assert(8 !in set);

Meta