Trying to understand a simple piece of code: dmd barray

drug drug2004 at bk.ru
Sat Mar 7 12:26:32 UTC 2020


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`
> 2. The struct has no property called length - but this is referenced. 
> Where does this come from?
it comes from `array` being alias for `this`, see above
> 
> Thank you
> 
> Regards



More information about the Digitalmars-d-learn mailing list