On Apr 9, 2012, at 10:46 PM, Andrei Alexandrescu <[email protected]> wrote:

> On 4/9/12 9:42 PM, Jason House wrote:
>> From a safety perspective, passing strict literals as "const ref" is
>> fine. There is no output to discard. I have a vague impression that
>> the restriction was put in place to allow some kind of optimization.
>> I bet it's discussed in TDPL somewhere...
> 
> Rvalues masquerading as references to constant values have caused enormous 
> harm to C++, culminating in the "fix" that was rvalue references.
> 
> Let's not repeat that values. Rvalues are rvalues and should stay that way.

I have never seen an explanation of D's  lack of rvalue references longer than 
this. Is there any online explanation/blog describing how this neatly avoids 
the need for the solution from C++? There has to be more to it than just 
creating a temporary variable when the compiler issues an error.
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta

Reply via email to