The intsets
module implements an efficient int set implemented as a sparse bit set. Note: Since Nim currently does not allow the assignment operator to be overloaded, =
for int sets performs some rather meaningless shallow copy; use assign
to get a deep copy.
IntSet = object elems: int counter, max: int head: PTrunk data: TrunkSeq a: array[0 .. 33, int]
proc contains(s: IntSet; key: int): bool {.raises: [], tags: [].}
proc incl(s: var IntSet; key: int) {.raises: [], tags: [].}
proc excl(s: var IntSet; key: int) {.raises: [], tags: [].}
proc containsOrIncl(s: var IntSet; key: int): bool {.raises: [], tags: [].}
proc initIntSet(): IntSet {.raises: [], tags: [].}
proc clear(result: var IntSet) {.raises: [], tags: [].}
proc isNil(x: IntSet): bool {.inline, raises: [], tags: [].}
proc assign(dest: var IntSet; src: IntSet) {.raises: [], tags: [].}
proc `$`(s: IntSet): string {.raises: [], tags: [].}
proc empty(s: IntSet): bool {.inline, deprecated, raises: [], tags: [].}
iterator items(s: IntSet): int {.inline, raises: [], tags: [].}
© 2006–2017 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/intsets.html