DIP74: Reference Counted Class Objects

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 26 15:12:50 PST 2015


Am Thu, 26 Feb 2015 14:53:16 -0800
schrieb Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org>:

> On 2/26/15 2:39 PM, Johannes Pfau wrote:
> > Looks very nice, some things to refine:
> >
> > "Any attributes are allowed on these methods."
> > * Should @safe and @trusted by disallowed as
> >    "@safe code may not issue explicit calls to
> >     opAddRef/opRelease"?
> > * Probably also add a note here that the functions must be inverse
> > and a note that they should be nothrow and/or final for performance.
> 
> OK. I don't want to impose many limitations - let users explore 
> possibilities. I added the recommendation.

Leaving the implementation of opAddRef/opRelease to the user really
opens some interesting possibilities. Wrapping manually
reference-counted C libraries is a rather obvious one but there are
probably more interesting cases.

Overall this proposal looks very nice :-)


More information about the Digitalmars-d mailing list