Concern about the ref return argument and scope

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 27 20:57:59 PST 2015


We are going to introduce 2 features that basically are 2 hacks 
working around the same problem : lifetime.

It may sound like any of these is useful and progress, and 
somehow it is, but that is going to create many feature for 
underpowered capabilities.

This is this kind of situation where simple and easy collide.

I'd suggest we get a proper lifetime management. For ref return, 
we can still make it safe by defining the lifetime of the ref 
return as the intersection of the lifetime of the ref parameters 
and call it a day. As far as I can tell, this cover the vast 
majority of cases.


More information about the Digitalmars-d mailing list