nim-ranges/ranges/ptr_arith.nim
2018-02-16 16:39:44 +02:00

6 lines
150 B
Nim

proc baseAddr*[T](x: openarray[T]): pointer = cast[pointer](x)
proc shift*(p: pointer, delta: int): pointer =
cast[pointer](cast[int](p) + delta)