On 3/7/20 7:26 AM, drug wrote:
07.03.2020 15:05, Dibyendu Majumdar пишет:
Hi,
I am trying to understand
https://github.com/dlang/dmd/blob/master/src/dmd/backend/barray.d.
Two questions:
1. What does this mean and why is it needed?
line 95: alias array this;
This means that `array` can be used instead of `this`
To expand on this, the compiler basically substitutes the symbol aliased
here for the item itself if all other members are a compiler error.
So for example, if you have:
barr.length;
and barr has no member length, it tries:
barr.array.length
-Steve