Proposal for design of 'scope' (Was: Re: Opportunities for D)

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 10 23:49:24 PDT 2014


On Thursday, 10 July 2014 at 20:10:38 UTC, Marc Schütz wrote:
> Instead of lifetime intersections with `&` (I believe Timon 
> proposed that in the original thread), simply specify multiple 
> "owners": `scope!(a, b)`. This works, because as far as I can 
> see there is no need for lifetime unions, only intersections.
>

There are unions.

class A {
    scope!s1(A) a;
}

scope!s2(A) b;

b.a; // <= this has union lifetime of s1 and s2.


More information about the Digitalmars-d mailing list