Hi folks!
So I had the following proc signature
proc insertsOrUpdates*[K, V](rbt: RedBlackTree[K, V], key: K, value: V): tuple[
inserted: bool, value: var V]
.
But it seems the returned value inside of the tuple wasn't functioning. Is this a valid syntax? Did an echo repr against the returned tuple. Here's what it prints: [Field0 = false, Field1 = (invalid data!)]
Thanks!
Thanks for replying.
Sorry but that's kinda not what I intended the function to return :(. Because I don't have a lvalue for "inserted" part of the tuple so that it can fit in into a var. Right (?)
The signature is weird anyway, how about:
proc insertsOrUpdates*[K, V](rbt: RedBlackTree[K, V], key: K, value: var V): bool