Y
Hacker News
new
|
ask
|
show
|
jobs
by
zesterer
664 days ago
That's... simply not true. Pointer arithmetic is not, in general, safe. Example:
https://doc.rust-lang.org/std/primitive.pointer.html#method....
1 comments
gpm
660 days ago
Eh... the ptr::add function exists if you want to make extra promises to the compiler to let it optimize better, but if you don't a safe version exists:
https://doc.rust-lang.org/std/primitive.pointer.html#method....
link