Rvalue references - The resolution
Steven Schveighoffer
schveiguy at yahoo.com
Mon May 6 11:10:27 PDT 2013
On Mon, 06 May 2013 13:53:10 -0400, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> On 5/6/13 1:45 PM, Steven Schveighoffer wrote:
>> This is a trimmed down example:
>>
>> int &foo(int &val) { return val; }
>>
>> What I read from you (and I could be wrong) is you are saying this is
>> not valid:
>>
>> foo(foo(foo(1)));
>>
>> Is that right?
>
> No. I believe I was very specific about what I destroyed and in all
> likelihood so do you. Probably at this point we've reached violent
> agreement a couple of iterations back.
OK, I was confused (seriously, I was not playing devil's advocate here).
We are in agreement (at least at what should be possible).
> Long story short: binding rvalues to ref is fraught with peril and must
> be designed very carefully.
I think empirical proof from this newsgroup is pretty good evidence.
-Steve
More information about the Digitalmars-d
mailing list