Isolated by example

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri May 2 06:54:57 PDT 2014


On Fri, 02 May 2014 09:50:07 -0400, Meta <jared771 at gmail.com> wrote:

> On Friday, 2 May 2014 at 06:51:49 UTC, deadalnix wrote:
>> An isolated is consumed when:
>>  - it is returned
>>  - it is passed as argument
>>  - it is assigned to another island
>
> This will not work well with UFCS.
>
> isolated int[] ints = new int[](10);
> //put looks like a member function, but
> //this desugars to put(ints, 3), so ints
> //is consumed
> ints.put(3);

Some interaction with pure would be in order. I don't think ints.put(3)  
should consume the ints. However, you have just lost the data you put,  
since ints cannot have any other reference to it!

-Steve


More information about the Digitalmars-d mailing list