Added test for #1846.

This commit is contained in:
Dominik Picheta
2016-01-16 13:58:40 +00:00
parent ac71ece673
commit 19ea2672c5

View File

@@ -0,0 +1,16 @@
type
TBinOp*[T] = proc (x,y: T): bool
THeap*[T] = object
cmp*: TBinOp[T]
proc less*[T](x,y: T): bool =
x < y
proc initHeap*[T](cmp: TBinOp[T]): THeap[T] =
result.cmp = cmp
when isMainModule:
var h = initHeap[int](less[int])
echo h.cmp(2,3)