fn EnumSet(comptime E: type) type
A set of enum elements, backed by a bitfield. If the enum is not dense, a mapping will be constructed from enum values to dense indices. This type does no dynamic allocation and can be copied by value.
Functions
fn differenceWith(self: Self, other: Self) Self
Returns a set with keys that are in this set except for keys in the other set.
fn intersectWith(self: Self, other: Self) Self
Returns a set with keys that are in both this set and the other set.
fn iterator(self: *const Self) Iterator
Returns an iterator over this set, which iterates in index order. Modification…
Returns an iterator over this set, which iterates in index order. Modifications to the set during iteration may or may not be observed by the iterator, but will not invalidate it.
fn setPresent(self: *Self, key: Key, present: bool) void
Changes the presence of a key in the set to match the passed bool.
fn subsetOf(self: Self, other: Self) bool
Returns true iff all the keys in this set are in the other set. The other set m…
Returns true iff all the keys in this set are in the other set. The other set may have keys not found in this set.
fn supersetOf(self: Self, other: Self) bool
Returns true iff this set contains all the keys in the other set. This set may …
Returns true iff this set contains all the keys in the other set. This set may have keys not found in the other set.
fn toggle(self: *Self, key: Key) void
Toggles the presence of a key in the set. If the key is in the set, removes it…
Toggles the presence of a key in the set. If the key is in the set, removes it. Otherwise adds it.