No description
Find a file
Avahe Kellenberger 049026f506 Added LICENSE
2023-03-11 12:26:59 -05:00
src Fixed contains function, wrote a test. 2022-09-10 23:57:16 -04:00
tests Fixed contains function, wrote a test. 2022-09-10 23:57:16 -04:00
LICENSE Added LICENSE 2023-03-11 12:26:59 -05:00
README.md Added example to README 2022-09-01 15:48:23 -04:00
safeset.nimble v0.1.1 2022-09-11 12:10:01 -04:00

SafeSet

SafeSet is a HashSet implementation that allows the users to safely add and remove elements while iterating.

It is not designed to be thread-safe.

Examples

See tests/safeset_test.nim for more comprehensive examples.

let safeset = newSafeSet[string]()
safeset.add("foobar")
assert(safeset.len == 1)

for item in safeset:
  safeset.remove("foobar")

assert(safeset.len == 0)