3 ms·
> It seems that noalias exactly means that the two arrays can never point to the same memory, thus they do not overlap. I think that `noalias` would enforce th
by Denvercoder9 6y ago
> It seems that noalias exactly means that the two arrays can never point to the same memory, thus they do not overlap.
I think that `noalias` would enforce that `s1` and `s2` aren't equal, but that doesn't mean that `s2` doesn't partially overlap with `s1` (i.e. it starts at an offset of `s1`).
- CyberRabbi 6y agoI see now. The signature itself would only require that the values passed in are not equal, not that the range doesn’t overlap. If that indeed was his criticism, that’s easily fixable. The standard could simply add language that says “noalias” must be true for the whole range of the array. Maybe that would prevent other practical use cases. I think his consistency argument is more powerful, if maybe less practical.
- deleted 6y ago[deleted]