[idea] Mutable pointee/ RCString

Iakh via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 7 06:00:24 PST 2016


Is it hard to make pointee data mutable?
E.g. if have:
------
struct RCString
{
     private char[] data;
     private @mutable int* counter;
}
------
So for optimiser (in case of immutable) this looks like
------
struct RCString
{
     private char[] data;
     private @mutable void* counter; // pointer to garbage
}
------


More information about the Digitalmars-d mailing list