On 8/22/21 6:03 AM, james.p.leblanc wrote:

>      struct Foo {
>          int a, b, c;
>          Foo* myadd;
>
>          this(int a, int b, int c) {
>              this.a = a;
>              this.b = b;
>              this.c = c;
>              this.myadd = &this;

As Matthias Lang mentioned, keeping a reference to itself makes a struct object illegal in D. D sees structs as value types: It is supposed that any copy can be used in place of another copy.

Ali

Reply via email to