The liabilities of binding rvalues to ref

Rob T alanb at ucora.com
Thu May 9 16:20:03 PDT 2013


On Thursday, 9 May 2013 at 22:42:14 UTC, Manu wrote:
> And it's
>> even questionable that scope as originally intended can be 
>> properly
>> implemented anyway.
>>
>
> ...so, the problem is no different than 'auto ref' as you 
> mention above.
> It's not implemented as drafted, and we're debating what's 
> actually
> correct. Clearly the draft was incomplete in both cases.
> I only support the proposal (from others) that scope ref makes 
> so much more
> sense, and I think we've also proven it can be made to work 
> syntactically
> without holes, which I don't believe is so for auto ref.
>

However despite the elusiveness of a solution, it looks like 
we'll be able to implement auto ref as was originally intended. 
We may also be able to implement scope as was originally 
intended, but not if we use it for another purpose.

In any event  you may want to use scope ref to prevent escapes 
and also refuse to use rvalues, so it is not a good solution for 
that reason alone.

--rt


More information about the Digitalmars-d mailing list