Types
StaticSeq[N; T] = object
- This is similar to seq, but internal storage size is fixed to N and it can be allocated on stack. So you can add only N items to this. Uses array as internal storage.
Procs
func toStaticSeq(src: static string): auto
func toStaticSeq[N: static Natural; T](src: static array[N, T]): StaticSeq[N, T]
func `{}=`(x: var StaticSeq; i: Natural; val: sink x.T) {.inline.}
- This is similar to []=, but you can assign with i larger than or equal to len. But i must be smaller than x.N. When you assign with i larger than or equal to len, len is automatically extended to i + 1, and elements in between old len to new len has default values.
Templates
template minimumSizeInt(N: static range[1 .. int.high]): untyped
template toOpenArray(x: StaticSeq; first, last: Natural): untyped
- Returns openArray[T] so that you can pass a part of x to a openArray[T] parameter of procs.
template toOpenArray(x: StaticSeq; first: Natural = 0): untyped