diff --git a/ranges/ptr_arith.nim b/ranges/ptr_arith.nim new file mode 100644 index 0000000..8f6b848 --- /dev/null +++ b/ranges/ptr_arith.nim @@ -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) +