Beta 2.075.0-b1

Martin Nowak via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Jul 5 00:25:34 PDT 2017


On Wednesday, 5 July 2017 at 01:40:49 UTC, Dsby wrote:
> Will add in language : @ref @weak?
> is it DIP47?
> Or in library?

We should be able to do it as library types.
The only case we currently know that might need help from the 
compiler, is passing multiple mutable rc/uniq references.

int boom(ref RC!S a, ref RC!int b)
{
    destroy(a);
    return b; // a might have been the sole owner of b
}

We might get away with disallowing calls with arguments, where 
one potentially owns the other. It looks like a minor use-case to 
me.
Incrementing the ref-count around the call was another option, 
but that wouldn't work with unique ownership.


More information about the Digitalmars-d-announce mailing list