summary refs log tree commit diff stats
path: root/lib/pure/collections/intsets.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-12-01 19:10:47 +0100
committerAraq <rumpf_a@web.de>2012-12-01 19:10:47 +0100
commitc98e3d2c274ac4bd4227d4e3f7e0d2636827f88c (patch)
treec9b624562ae38f56d19e7ed190307caea8c61241 /lib/pure/collections/intsets.nim
parentf503439e811d822f19daa9591cb3bd9e90edabe7 (diff)
downloadNim-c98e3d2c274ac4bd4227d4e3f7e0d2636827f88c.tar.gz
implements 'export' feature
Diffstat (limited to 'lib/pure/collections/intsets.nim')
-rwxr-xr-xlib/pure/collections/intsets.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pure/collections/intsets.nim b/lib/pure/collections/intsets.nim
index fcaf7b212..2a8d7eec2 100755
--- a/lib/pure/collections/intsets.nim
+++ b/lib/pure/collections/intsets.nim
@@ -190,6 +190,11 @@ proc `$`*(s: TIntSet): string =
   ## The `$` operator for int sets.
   dollarImpl()
 
+proc empty*(s: TIntSet): bool {.inline.} =
+  ## returns true if `s` is empty. This is safe to call even before
+  ## the set has been initialized with `initIntSet`.
+  result = s.counter == 0
+
 when isMainModule:
   var x = initIntSet()
   x.incl(1)