DIP74: Reference Counted Class Objects

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 26 17:41:36 PST 2015


On 2/26/15 3:12 PM, Johannes Pfau wrote:
> 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.

Yah, this should dovetail real nice with allocators too.

> Overall this proposal looks very nice :-)

Still looking for some sword to fall :o).


Andrei



More information about the Digitalmars-d mailing list