introduce temporary <//> for 'owned' to get this compile with 0.19 (#11145)
* introduce temporary <//> for 'owned' to get this compile with 0.19 * make newTable[string, owned Node]() compile (but it crashes) * make sink/owned parameters consistent * make actiontable test compile again * VM: support sytem.move; makes tests green
This commit is contained in:
parent
c94ab46923
commit
e1515b53d1
9 changed files with 69 additions and 46 deletions
|
|
@ -80,14 +80,15 @@ type
|
|||
DoublyLinkedNodeObj*[T] = object ## A node a doubly linked list consists of.
|
||||
##
|
||||
## It consists of a `value` field, and pointers to `next` and `prev`.
|
||||
next*, prev*: ref DoublyLinkedNodeObj[T]
|
||||
next*: <//>(ref DoublyLinkedNodeObj[T])
|
||||
prev*: ref DoublyLinkedNodeObj[T]
|
||||
value*: T
|
||||
DoublyLinkedNode*[T] = ref DoublyLinkedNodeObj[T]
|
||||
|
||||
SinglyLinkedNodeObj*[T] = object ## A node a singly linked list consists of.
|
||||
##
|
||||
## It consists of a `value` field, and a pointer to `next`.
|
||||
next*: ref SinglyLinkedNodeObj[T]
|
||||
next*: <//>(ref SinglyLinkedNodeObj[T])
|
||||
value*: T
|
||||
SinglyLinkedNode*[T] = ref SinglyLinkedNodeObj[T]
|
||||
|
||||
|
|
@ -95,19 +96,22 @@ type
|
|||
##
|
||||
## Use `initSinglyLinkedList proc <#initSinglyLinkedList>`_ to create
|
||||
## a new empty list.
|
||||
head*, tail*: SinglyLinkedNode[T]
|
||||
head*: <//>(SinglyLinkedNode[T])
|
||||
tail*: SinglyLinkedNode[T]
|
||||
|
||||
DoublyLinkedList*[T] = object ## A doubly linked list.
|
||||
##
|
||||
## Use `initDoublyLinkedList proc <#initDoublyLinkedList>`_ to create
|
||||
## a new empty list.
|
||||
head*, tail*: DoublyLinkedNode[T]
|
||||
head*: <//>(DoublyLinkedNode[T])
|
||||
tail*: DoublyLinkedNode[T]
|
||||
|
||||
SinglyLinkedRing*[T] = object ## A singly linked ring.
|
||||
##
|
||||
## Use `initSinglyLinkedRing proc <#initSinglyLinkedRing>`_ to create
|
||||
## a new empty ring.
|
||||
head*, tail*: SinglyLinkedNode[T]
|
||||
head*: <//>(SinglyLinkedNode[T])
|
||||
tail*: SinglyLinkedNode[T]
|
||||
|
||||
DoublyLinkedRing*[T] = object ## A doubly linked ring.
|
||||
##
|
||||
|
|
@ -147,7 +151,7 @@ proc initDoublyLinkedRing*[T](): DoublyLinkedRing[T] =
|
|||
var a = initDoublyLinkedRing[int]()
|
||||
discard
|
||||
|
||||
proc newDoublyLinkedNode*[T](value: T): DoublyLinkedNode[T] =
|
||||
proc newDoublyLinkedNode*[T](value: T): <//>(DoublyLinkedNode[T]) =
|
||||
## Creates a new doubly linked node with the given `value`.
|
||||
runnableExamples:
|
||||
var n = newDoublyLinkedNode[int](5)
|
||||
|
|
@ -156,7 +160,7 @@ proc newDoublyLinkedNode*[T](value: T): DoublyLinkedNode[T] =
|
|||
new(result)
|
||||
result.value = value
|
||||
|
||||
proc newSinglyLinkedNode*[T](value: T): SinglyLinkedNode[T] =
|
||||
proc newSinglyLinkedNode*[T](value: T): <//>(SinglyLinkedNode[T]) =
|
||||
## Creates a new singly linked node with the given `value`.
|
||||
runnableExamples:
|
||||
var n = newSinglyLinkedNode[int](5)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue