Want reasonable reference counting? Disable automatic sharing of immutable

sclytrack fake at hotmail.com
Tue Nov 30 19:11:09 UTC 2021


On Friday, 12 November 2021 at 12:31:03 UTC, Steven Schveighoffer 
wrote:
> One of the prerequisites to doing reference counting is to have 
> a mutable piece of data inside an immutable piece of data.
>
> -Steve


I've been thinking and the origin of a reference counted type 
should be mutable or
const and never immutable. Make it illegal to create immutable 
reference counted types.

Then Andrei can apply its cheat codes to const and only const. 
Never to immutable.

So const(RCType) and never immutable(RCType);

I believe there is const and shared const. So immutable remains 
immutable forever
and ever and ever.
















More information about the Digitalmars-d mailing list