Re: Details on how aggregates are constructed with `new` and later destroyed by the GC

2018-10-08 Thread Stanislav Blinov via Digitalmars-d-learn
On Monday, 8 October 2018 at 11:19:40 UTC, Per Nordlöw wrote: And how this is related to the trait `hasElaborateConstructor` for both `classes` and `structs`. There's no such trait as far as I'm aware. If there were, it'd likely be checking for the presence of a '__ctor' member. Thing is, it

Re: Details on how aggregates are constructed with `new` and later destroyed by the GC

2018-10-08 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 8 October 2018 at 11:19:40 UTC, Per Nordlöw wrote: I want to understand how calls to `new` for classes see _d_newclass and structs are lowered by the compiler and druntime to a GC-allocation (specifically how the `ba`-argument bits are determined) followed by an initialization

Details on how aggregates are constructed with `new` and later destroyed by the GC

2018-10-08 Thread Per Nordlöw via Digitalmars-d-learn
I want to understand how calls to `new` for classes and structs are lowered by the compiler and druntime to a GC-allocation (specifically how the `ba`-argument bits are determined) followed by an initialization using default constructor or via a user-defined constructor called using arguments