DIP74: Reference Counted Class Objects

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 26 18:21:48 PST 2015


On Thu, Feb 26, 2015 at 06:06:04PM -0800, Andrei Alexandrescu via Digitalmars-d wrote:
> On 2/26/15 5:59 PM, H. S. Teoh via Digitalmars-d wrote:
> >On Thu, Feb 26, 2015 at 05:44:36PM -0800, Andrei Alexandrescu via Digitalmars-d wrote:
> >[...]
> >>An interesting option to explore in the future would be rigging
> >>druntime to add opAddRef and opRelease to Object.
> >[...]
> >
> >How would that work? Doesn't that immediately subject *all* classes
> >to the restrictions set forth in DIP74?
> 
> It does - but that might be fine with some applications. -- Andrei

But putting it into druntime imposes it on *all* applications, because
either opAddRef/opRelease are declared in Object, or they are not, and
this decision is made long before the user writes his application.


T

-- 
In theory, software is implemented according to the design that has been carefully worked out beforehand. In practice, design documents are written after the fact to describe the sorry mess that has gone on before.


More information about the Digitalmars-d mailing list