The liabilities of binding rvalues to ref

Timon Gehr timon.gehr at gmx.ch
Thu May 9 15:35:27 PDT 2013


On 05/09/2013 09:43 PM, Andrei Alexandrescu wrote:
> On 5/9/13 3:39 PM, Rob T wrote:
>> So, if I understand correctly, auto ref for templates will end up doing
>> exactly the same thing as auto ref for non-template functions? That
>> would be perfect, otherwise it'll be terribly confusing.
>
> There would be clear restrictions on non-template functions, e.g. a
> non-template cannot return auto ref.
>
> Andrei
>

Returning auto ref is fine as long as no auto ref argument is returned.


More information about the Digitalmars-d mailing list