Set.opIndex

Returns a bidirectional range over the container.

  1. Range opIndex()
  2. ConstRange opIndex()
    struct Set(T, alias hasher = hash)
    const
    opIndex
    ()
    if (
    isHashFunction!(hasher, T)
    )

Return Value

A bidirectional range that iterates over the container.

Examples

Set!int set;
assert(set[].empty);

set.insert(8);
assert(!set[].empty);
assert(set[].front == 8);
assert(set[].back == 8);

Meta