2 ms·
> If you could redesign the above mechanism, would you do anything differently? Nope. It was a home run. > All that goes out the window when you want to do FF
by WalterBright 4y ago
> If you could redesign the above mechanism, would you do anything differently?
Nope. It was a home run.
> All that goes out the window when you want to do FFI to some C function.
And there you go! What D does, though, is bounds check the conversion of an array to a pointer, and then (in code marked @safe) not allow arithmetic on the pointer.
Additionally, D introduced the `ref` parameter which eliminates nearly all use cases of needing to pass by pointer to a function.