Rvalue references - The resolution
Walter Bright
newshound2 at digitalmars.com
Sat May 4 19:04:21 PDT 2013
On 5/4/2013 6:44 PM, Jonathan M Davis wrote:
> On Saturday, May 04, 2013 20:37:36 Andrei Alexandrescu wrote:
>> On 5/4/13 7:31 PM, Walter Bright wrote:
>>> On 5/4/2013 3:51 PM, w0rp wrote:
>>>> Does all of this also mean that a
>>>> function with a ref parameter will automagically work with r-values?
>>>
>>> Yes.
>>
>> This is new to me. My understanding is that the discussed design
>> addresses safety, and leaves the rvalue discussion for a future iteration.
>
> That is definitely where things were when we ended the discussion on Wednesday
> night. Walter favored making ref accept rvalues, but we never agreed on that.
> Manu was still in favor of scop ref (and David Nadlinger agreed with him
> IIRC), and you and I were arguing for auto ref to designate that a function
> accepts rvalues. We all agreed on the bounds check solution for @safety, but
> we explicitly tabled the discussion about accepting rvalues, because it was
> getting late, and we'd already been discussing it / arguing about it for quite
> some time. So, unless further discussion occurred after that which I missed,
> there is still no agreement on how to handle having a parameter accept both
> lvalues and rvalues by ref.
That wasn't my understanding. I thought we agreed that since rvalues would be
copied to locals, and then the issue was one of escaping local references.
We did explicitly defer discussion about what happens with "nop" rvalue conversions.
More information about the Digitalmars-d
mailing list