make tsigbreak.nim compile

This commit is contained in:
Andreas Rumpf
2016-12-12 14:08:01 +01:00
parent 34143ee122
commit e169eaac5b
5 changed files with 42 additions and 7 deletions

28
tests/cpp/tsigbreak.nim Normal file
View File

@@ -0,0 +1,28 @@
discard """
cmd: "nim cpp $file"
"""
import tables, lists
type
ListTable[K, V] = object
table: Table[K, DoublyLinkedNode[V]]
proc initListTable*[K, V](initialSize = 64): ListTable[K, V] =
result.table = initTable[K, DoublyLinkedNode[V]]()
proc `[]=`*[K, V](t: var ListTable[K, V], key: K, val: V) =
t.table[key].value = val
type
SomeObj = object
OtherObj = object
proc main() =
var someTable = initListTable[int, SomeObj]()
var otherTable = initListTable[int, OtherObj]()
someTable[1] = SomeObj()
otherTable[42] = OtherObj()
main()