On 31.07.20 01:42, wjoe wrote:
I could swear just a few weeks ago there was someone asking how to tell if an array was null or of length 0 and an answer was that it's the same and can't be distinguished so I assumed that assigning a slice of 0 length is the same as setting the array to null because the result is the same as a 0 length array.

This one?
https://forum.dlang.org/thread/xgnbzpziqmjyjfsql...@forum.dlang.org

`[]` is the same as `null`.

While `b[0 .. 0]` is empty like `[]`, it is not the same (unless `b` is already `[]`/`null`). The `.ptr`s are different.

Reply via email to