[dmd-beta] D 2.059 beta 4

Andrei Alexandrescu andrei at erdani.com
Mon Apr 9 19:46:02 PDT 2012


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.

What is in essence the problem to be solved? My understanding is that a 
thunk function would be appropriate here.


Andrei


More information about the dmd-beta mailing list