diff options
author | Araq <rumpf_a@web.de> | 2012-12-01 19:10:47 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-12-01 19:10:47 +0100 |
commit | c98e3d2c274ac4bd4227d4e3f7e0d2636827f88c (patch) | |
tree | c9b624562ae38f56d19e7ed190307caea8c61241 /lib/pure/collections/intsets.nim | |
parent | f503439e811d822f19daa9591cb3bd9e90edabe7 (diff) | |
download | Nim-c98e3d2c274ac4bd4227d4e3f7e0d2636827f88c.tar.gz |
implements 'export' feature
Diffstat (limited to 'lib/pure/collections/intsets.nim')
-rwxr-xr-x | lib/pure/collections/intsets.nim | 5 |
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) |