Import std.collections.immutable
ImmutableSet
struct
@DebugElements Public Struct ImmutableSet<T> Implements Iterable<T>, Defaultable, Sendable, Hashable
A Set that never changes: each change gives a new one, which shares what it can with the old, so threads can share it.
Examples
Local a = ImmutableSet<Int>().AddAll([1, 2])
Local b = a.Add(3)
Expect(a.Count == 2 && b.Count == 3)
Expect(b.Contains(3) && !a.Contains(3))std/collections/immutable.fb, line 750
-
An empty one.
-
One with the
values, all read first. -
How many values it holds.
-
Whether it holds
value. -
A copy with the
value, or the same one when it has it. -
A copy with each of the
valuesadded, all read first. -
A copy without the
value, or the same one when it hasn't got it. -
The values, in a new array, in the order they go in.
-
An empty one.
-
Two ImmutableSets are equal when they have the same values.
-
Equal ImmutableSets have equal hashes, whatever order their values go in.
-
The values, by their hashes, and values of one hash in the order they were added.
Report an issue with this page or with FutureBlitz on GitHub.