crash when using &this in struct constructor

Adam D. Ruppe destructionator at gmail.com
Mon Jul 16 22:16:10 UTC 2018


On Monday, 16 July 2018 at 22:08:34 UTC, Eric wrote:
> This makes the compiler crash. Is it illegal code?

Yes, a struct can be moved at any time by the compiler which 
means pointers to it can be invalidated at random.

Unless you always allocate it externally yourself...


More information about the Digitalmars-d-learn mailing list