Making RCSlice and DIP74 work with const and immutable

ted via Digitalmars-d digitalmars-d at puremagic.com
Sat Feb 28 18:44:53 PST 2015


Andrei Alexandrescu wrote:

> 
> We have a few candidates for solutions, but wanted to open with a good
> discussion first. So, how do you envision a way to define and access
> mutable metadata for objects (including immutable ones)?
> 
> 
> Andrei

It seems to me that (in the particular case of _this_ RC metadata - not 
attempting to cover any more general case (beyond my ken)), the compiler 
could internally mark class members that are modified inside the 
opAddRef/opRelease methods as mutable. This would not require any special 
source code markups.
--ted


More information about the Digitalmars-d mailing list