Add initSequenceOfCap proc

This commit is contained in:
Emery Hemingway 2023-03-29 17:33:39 -05:00
parent 71b6d4c017
commit 466a8d3af4
1 changed files with 4 additions and 0 deletions

View File

@ -317,6 +317,10 @@ proc initSequence*(len: Natural = 0; E = void): Preserve[E] =
## Create a Preserves sequence value.
Preserve[E](kind: pkSequence, sequence: newSeq[Preserve[E]](len))
proc initSequenceOfCap*(cap: Natural; E = void): Preserve[E] =
## Create a Preserves sequence value.
Preserve[E](kind: pkSequence, sequence: newSeqOfCap[Preserve[E]](cap))
proc initSet*(E = void): Preserve[E] = Preserve[E](kind: pkSet)
## Create a Preserves set value.