Making RCSlice and DIP74 work with const and immutable

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sat Feb 28 18:22:21 PST 2015


On 2/28/15 5:57 PM, Manu via Digitalmars-d wrote:
> Perhaps an operator that may be implemented to return a mutable
> metadata pointer for objects? From an algebraic point of view, it
> should be defined that mutating metadata will have no effect on the
> actual object.

But how would custom data be defined?

> Interestingly, I wonder if such an approach may also be used to
> satisfy a common problem that people have with const objects, where
> it's not possible to implement caching systems for repeated work
> optimisation?
> The result cache is another thing that may be stored in the object's
> metadata...?

That's already abuse. No.


Andrei



More information about the Digitalmars-d mailing list