File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 212212- Added ` progressInterval ` argument to ` asyncftpclient.newAsyncFtpClient ` to control the interval
213213 at which progress callbacks are called.
214214
215+ - Added module ` pointers ` containing ` toUncheckedArray `
215216
216217## Language changes
217218
Original file line number Diff line number Diff line change 1+ ##[
2+ Convenience procs to deal with pointer-like variables.
3+ ]##
4+
5+ proc toUncheckedArray * [T](a: ptr [T]): ptr UncheckedArray [T] {.inline .} =
6+ # # calls `cast[ptr UncheckedArray[T]]` (less error prone).
7+ runnableExamples:
8+ var a = @ [10 , 11 , 12 ]
9+ let pa = a[1 ].addr .toUncheckedArray
10+ doAssert pa[- 1 ] == 10
11+ pa[0 ] = 100
12+ doAssert a == @ [10 , 100 , 12 ]
13+ pa[0 ] += 5
14+ doAssert a[1 ] == 105
15+ cast [ptr UncheckedArray [T]](a)
You can’t perform that action at this time.
0 commit comments