rvalue references

Namespace via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 2 14:28:03 PDT 2015


On Tuesday, 2 June 2015 at 21:20:49 UTC, Andrei Alexandrescu 
wrote:
> Yah, auto ref for templates is great. We only need to add auto 
> ref for non-templates with the semantics "like ref, except (a) 
> accepts rvalues on the caller side, (b) does not allow escaping 
> the ref from the function".
That would work once DIP 25 is fully implemented and if auto ref 
for non-templates would not include return ref. Or am I missing 
something?

> Note that __traits(isRef, param) doesn't work in an auto ref 
> param in a non-template function (attempt to use must be a 
> compile-time error).
>
> That's about it.
>
>
> Andrei



More information about the Digitalmars-d mailing list