Want reasonable reference counting? Disable automatic sharing of immutable

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sun Nov 14 08:29:33 UTC 2021


On Sunday, 14 November 2021 at 06:53:24 UTC, Elronnd wrote:
> So it seems not at all inconsistent to me that a pure function 
> may cause the GC to run, causing a destructor to be run.

Thus pure functions are allowed to conduct I/O, albeit a 
primitive one.

Note that a pure function also can prevent destruction merely by 
computing an integer that is aliasing an address of an object 
that is up for destruction. Again, primitive I/O. So clearly a 
side effect.




More information about the Digitalmars-d mailing list