We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
toOpenArray
ptr UncheckedArray[T]
1 parent 1c25b6e commit 04f5c91Copy full SHA for 04f5c91
lib/std/system/openarrays.nim
@@ -50,3 +50,6 @@ proc `==`*[T: Equatable](a, b: openArray[T]): bool =
50
if a[i] != b[i]: return false
51
return true
52
return false
53
+
54
+proc toOpenArray*[T](x: ptr UncheckedArray[T]; first, last: int): openArray[T] =
55
+ openArray[T](a: cast[ptr UncheckedArray[T]](cast[uint](x) + uint(first * sizeof(T))), len: last - first + 1)
0 commit comments