Re:Talking with the Inventor of C++
by WalterBright on Sunday December 03, 2023 @01:31AM
(#38505304)
The D language dynamic array, which is a pointer+length pair, has (over time) nearly completely supplanted pointer arithmetic. The pair prevents buffer overflows and underflows.
Raw pointer arithmetic is not allowed in code marked @safe.
Raw pointer arithmetic is not allowed in code marked @safe.
I've proposed it for C and C++:
https://www.digitalmars.com/articles/C-biggest-mistake.html
It would be simple to add it, and would be legacy compatible.