Blog: GC

Imperatorn johan_forsberg_86 at hotmail.com
Sat Mar 6 21:08:45 UTC 2021


On Saturday, 6 March 2021 at 20:45:00 UTC, Adam D. Ruppe wrote:
> On Saturday, 6 March 2021 at 20:21:41 UTC, Rumbu wrote:
>> [...]
>
> D *does* have deterministic class destruction. `scope Object o 
> = new Object;`. Also `scope(exit) .destroy(o);`.
>
> The blog is kinda awkward because it says "pretend class 
> destructors don't exist" now, but the next parts are going to 
> explain how he's lying to you.
>
> Class destructors do exist in D, just you need to take care to 
> use them properly (especially since the old `scope class` was 
> deprecated. Note this is distinct from the not-deprecated 
> `scope Object` construct.). So the early advice is to pretend 
> they don't exist. Then once you level up a little you can learn 
> the truth.

Oh, it's like scientology? 😱

Xenu


More information about the Digitalmars-d mailing list