intsets.nim 583 B

123456789101112131415161718192021222324
  1. #
  2. #
  3. # Nim's Runtime Library
  4. # (c) Copyright 2012 Andreas Rumpf
  5. #
  6. # See the file "copying.txt", included in this
  7. # distribution, for details about the copyright.
  8. #
  9. ## Specialization of the generic `packedsets module <packedsets.html>`_
  10. ## (see its documentation for more examples) for ordinal sparse sets.
  11. import std/private/since
  12. import std/packedsets
  13. export packedsets
  14. type
  15. IntSet* = PackedSet[int]
  16. proc toIntSet*(x: openArray[int]): IntSet {.since: (1, 3), inline.} = toPackedSet[int](x)
  17. proc initIntSet*(): IntSet {.inline.} = initPackedSet[int]()