On Wednesday, 25 August 2021 at 12:23:06 UTC, Adam D Ruppe wrote:
...
Thanks - that explains in all.
On Wednesday, 25 August 2021 at 12:23:32 UTC, FeepingCreature
wrote:
class Alias_Class
{
Test_Struct ts;
Test_Struct getter() { return ts; }
alias getter this;
}
Good idea,
On Wednesday, 25 August 2021 at 12:23:06 UTC, Adam D Ruppe wrote:
[snip]
That's a lot about alias this that I didn't know. Thanks.
On Wednesday, 25 August 2021 at 12:11:01 UTC, Johann Lermer wrote:
Hi all,
I have a little problem understanding alias this. I always
thought, that alias this only makes implicit conversions from
the aliased object to this. Then, why do lines 18 and 22
compile in the code below? And, btw,
On Wednesday, 25 August 2021 at 12:11:01 UTC, Johann Lermer wrote:
I have a little problem understanding alias this. I always
thought, that alias this only makes implicit conversions from
the aliased object to this.
What it does is if "a SOMETHING b" doesn't compile, it instead
tries
On Wednesday, 25 August 2021 at 12:11:01 UTC, Johann Lermer wrote:
```d
14 void main ()
15 {
16 auto ac = new Alias_Class;
17 Test_Struct ts = ac; // compiles
18 ac = ts; // compiles as well - why?
19
20 auto tc = new Test_Class;
21 ts = tc.ac; //
Hi all,
I have a little problem understanding alias this. I always
thought, that alias this only makes implicit conversions from the
aliased object to this. Then, why do lines 18 and 22 compile in
the code below? And, btw, line 22 crashes with a segmentation
fault.
```d
01 struct