On 5/6/13 1:45 PM, Steven Schveighoffer wrote:
On Mon, 06 May 2013 13:28:18 -0400, Andrei Alexandrescu
<[email protected]> wrote:
On 5/6/13 12:17 PM, Steven Schveighoffer wrote:
On Mon, 06 May 2013 12:03:27 -0400, Andrei Alexandrescu
<[email protected]> wrote:
No. It's a very different thing handled by a special rule in C++.
This isn't helping. You keep saying its different but not how.
In one case a reference is returned, in the other an rvalue is returned.
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.
Long story short: binding rvalues to ref is fraught with peril and must
be designed very carefully.
Andrei