3 ms·
When will they add a slice (fat pointer) type? I.e. a generic version of > struct T_slice { T* ptr; size_t len; }; with all the syntactic sugar and bounds che
by rando14775 4y ago
When will they add a slice (fat pointer) type? I.e. a generic version of
> struct T_slice { T* ptr; size_t len; };
with all the syntactic sugar and bounds checks added in. This could catch so many out of bounds issues and doesn't seem that hard to do.
- axus 4y agoThe author listed "wide pointers" in the second paragraph of things they are impatient for, and would like a faster release cycle for. It sounds like it could be another 10 years.
- __phantomderp 4y agoThe original authors of the language also advocated for this, and Walter Bright's D compiler has a BetterC compiler that also includes a int arr[..]; syntax for such things. But, our plates are full and the proposal wasn't written: it'll be up for next release, for sure, and it's one of the many things I would like to put in the language.