Destructors vs. Finalizers
jmh530 via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jul 26 06:08:36 PDT 2017
On Wednesday, 26 July 2017 at 12:55:17 UTC, Mike Parker wrote:
>> ---
>> ~this() {} // Finalizer
>> ~this() @nogc {} // Finalizer
>> ~this @deterministic {} // Destructor
>> ~this @nogc @deterministic {} // Destructor
>> }
>
> Yeah, this brings with it more flexibility. I'd prefer to avoid
> adding a new attribute for it, but this looks more interesting.
>
>
Some other options:
~~this() {}
!this() {}
!~this() {}
this!(true) () {} //not really a big fan of this version
More information about the Digitalmars-d
mailing list