Blog: GC

Rumbu rumbu at rumbu.ro
Sun Mar 7 07:22:14 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;`.

Thank you Adam for opening my eyes, I lived with the impression 
for years that scope initialization for classes is deprecated. In 
this case, the documentation must be clear that only "scope 
classes" are scheduled for deprecation, and this does not include 
"scope initialization".

Sorry, but when the chapter of scope classes starts with the note 
of deprecation, I assume that it is referring the entire chapter:

https://dlang.org/spec/class.html#auto

Yes, if you go further in deprecation details, you will find it 
written as a comment in a code example:

https://dlang.org/deprecate.html#scope%20as%20a%20type%20constraint


Believe it or not, a code comment is not the best place to put 
such important note.




More information about the Digitalmars-d mailing list