From c98e3d2c274ac4bd4227d4e3f7e0d2636827f88c Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 1 Dec 2012 19:10:47 +0100 Subject: implements 'export' feature --- lib/pure/collections/intsets.nim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/pure/collections') 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) -- cgit 1.4.1-2-gfad0