Re: alias this and struct allocation

2019-05-06 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 6 May 2019 at 14:48:56 UTC, faissaloo wrote: misunderstood how allocation works when instantiating a struct that uses alias this: alias this has no effect on allocation at all. All it does is if x.y doesn't compile, it rewrites it to x.alias_this.y (or if f(x) doesn't work, it

Re: alias this and struct allocation

2019-05-06 Thread Alex via Digitalmars-d-learn
On Monday, 6 May 2019 at 14:48:56 UTC, faissaloo wrote: I've been having some memory issues (referenced objects turning to nulls for no apparent reason) and I was wondering if I've misunderstood how allocation works when instantiating a struct that uses alias this: import std.stdio;

Re: alias this and struct allocation

2019-05-06 Thread faissaloo via Digitalmars-d-learn
On Monday, 6 May 2019 at 15:17:37 UTC, aliak wrote: Do you have an example of a referenced object turning to null? We may be able to spot something Unfortunately I haven't managed to produce an example any smaller than my entire codebase

Re: alias this and struct allocation

2019-05-06 Thread aliak via Digitalmars-d-learn
On Monday, 6 May 2019 at 14:48:56 UTC, faissaloo wrote: I've been having some memory issues (referenced objects turning to nulls for no apparent reason) and I was wondering if I've misunderstood how allocation works when instantiating a struct that uses alias this: import std.stdio;

alias this and struct allocation

2019-05-06 Thread faissaloo via Digitalmars-d-learn
I've been having some memory issues (referenced objects turning to nulls for no apparent reason) and I was wondering if I've misunderstood how allocation works when instantiating a struct that uses alias this: import std.stdio; struct Parent { int a;