mirror of
https://github.com/status-im/nim-ranges.git
synced 2025-02-17 23:27:04 +00:00
pointer arithmetic helpers
This commit is contained in:
parent
9815d9708f
commit
ee803f088f
5
ranges/ptr_arith.nim
Normal file
5
ranges/ptr_arith.nim
Normal file
@ -0,0 +1,5 @@
|
||||
proc baseAddr*[T](x: openarray[T]): pointer = cast[pointer](x)
|
||||
|
||||
proc shift*(p: pointer, delta: int): pointer =
|
||||
cast[pointer](cast[int](p) + delta)
|
||||
|
Loading…
x
Reference in New Issue
Block a user