Re: Trying to understand a simple piece of code: dmd barray

2020-03-07 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Saturday, 7 March 2020 at 14:33:29 UTC, Steven Schveighoffer wrote: It's D's version of implicit conversion. You can make the alias this a no-arg function and it will try calling that function. Okay thank you.

Re: Trying to understand a simple piece of code: dmd barray

2020-03-07 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 7 March 2020 at 13:06:39 UTC, Dibyendu Majumdar wrote: On Saturday, 7 March 2020 at 12:26:32 UTC, drug wrote: 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

Re: Trying to understand a simple piece of code: dmd barray

2020-03-07 Thread Steven Schveighoffer via Digitalmars-d-learn
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 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

Re: Trying to understand a simple piece of code: dmd barray

2020-03-07 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Saturday, 7 March 2020 at 12:26:32 UTC, drug wrote: 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`

Re: Trying to understand a simple piece of code: dmd barray

2020-03-07 Thread Steven Schveighoffer via Digitalmars-d-learn
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

Re: Trying to understand a simple piece of code: dmd barray

2020-03-07 Thread drug via Digitalmars-d-learn
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 s

Trying to understand a simple piece of code: dmd barray

2020-03-07 Thread Dibyendu Majumdar via Digitalmars-d-learn
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; 2. The struct has no property called length - but this is referenced. Where does this come from? Thank y