DIP69 - Implement scope for escape proof references

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 11 22:57:52 PST 2014


On Friday, 12 December 2014 at 06:06:40 UTC, Dicebot wrote:
> On Thursday, 11 December 2014 at 21:41:11 UTC, Walter Bright 
> wrote:
>> Consider a ref counted type, RC!T. If scope were transitive, 
>> then you could not have, say, a tree where the edges were 
>> RC!T. I.e., the payload of an RC type should not be forced to 
>> be scope.
>
> I don't see how this is related. It would be perfectly ok to 
> declare root of such tree scope if it was transitive (as long 
> as it only controls access and does not attempt early 
> destruction).
>

That is my proposal. However, it is not as simply as you think it 
is without making it a type qualifier (which is not desirable).

In effect, that mean that you can see something that has infinite 
lifetime through a scope reference, so you need to track lifetime 
rvalue and lvalue differently.

I'm still for it. The current proposal is not powerful enough to 
pull its weight.


More information about the Digitalmars-d mailing list