Trying to understand a simple piece of code: dmd barray
schveiguy at gmail.com
Sat Mar 7 14:33:29 UTC 2020
On 3/7/20 8:06 AM, Dibyendu Majumdar wrote:
> On Saturday, 7 March 2020 at 12:26:32 UTC, drug wrote:
>>> I am trying to understand
>>> 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`
> Hmm should not that change the meaning of this throughout the struct? is
> this good practice?
No, it's simply a fallback. If the symbol doesn't work with this.symbol,
It's D's version of implicit conversion.
You can make the alias this a no-arg function and it will try calling
More information about the Digitalmars-d-learn