Rvalue references - The resolution

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon May 6 10:28:18 PDT 2013


On 5/6/13 12:17 PM, Steven Schveighoffer wrote:
> On Mon, 06 May 2013 12:03:27 -0400, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> 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.

> I repeat,
> isn't it possible to solve the problem of binding rvalues to references?
> Yours and my examples seem to say it works in C++, but yet you say it's
> not feasible in D. Why is C++ able to handle this while D is not?

I explained twice: min and other similar C++ examples are broken.

>> Yes. My point was to illustrate that a special rule that works in a
>> situation can't help another.
>
> Another situation that's already solved? Don't see the point.

No. That situation leads to undefined behavior.


Andrei


More information about the Digitalmars-d mailing list