The liabilities of binding rvalues to ref

Steven Schveighoffer schveiguy at yahoo.com
Thu May 9 06:00:43 PDT 2013


On Thu, 09 May 2013 04:20:02 -0400, Manu <turkeyman at gmail.com> wrote:

>
> Ah yes, right, C++ fix() would need to be 'const ref&', but we decide in  
> D
> that 'ref const()' is too restrictive.

I have no problem with ref const accepting rvalues.  As I understand it,  
Andrei's objection (and this may be wrong/incomplete) is that then there  
is no way to say you accept only lvalues as const ref and rvalues via  
non-ref (for performance reasons).  But I think there is no technical  
reason preventing that with D.

-Steve


More information about the Digitalmars-d mailing list