Why is this still possible?
int[] arr = new int[50];
auto ptr = cast(int *)arr;
- casting is a blunt instrument, and can cause some really bad problems on code eveolution.
- Literally easier to do arr.ptr instead of cast(T*)arr
Can we get rid of this? If you need the cast mechanism, and you really mean it, you can do cast(T*)arr.ptr
The biggest problem is that people using C API which take char *
instead of string
or whatnot, use cast
and come to discord/etc with the inevitable problems this causes.
-Steve