Want reasonable reference counting? Disable automatic sharing of immutable

Elronnd elronnd at elronnd.net
Mon Nov 15 10:50:00 UTC 2021


On Monday, 15 November 2021 at 09:28:41 UTC, Danni Coy wrote:
> rather than punching a hole in const/immutable
>
> struct S
> meta {
> int refCount;
> ....
> }
> do {
>  int payload;
> ....
> }
>
> Immutable S s is now conceptually an immutable object and a 
> mutable
> object with metadata behind the scenes
> that feels like a single object from a user perspective?

That is functionally the same thing as '__mutable int refCount', 
discussed elsethread.


More information about the Digitalmars-d mailing list