My thoughts & tries with rvalue references

Namespace rswhite4 at googlemail.com
Tue Apr 2 23:19:57 PDT 2013


> It might seem convenient to use the syntax 'auto ref' to tell a 
> non-templated function to do this, but that syntax has been 
> rejected for reasons I either never understood well enough or 
> I've simply forgotten.
In my first post I link to Jonathan response to this.

> All-in-all, the syntax 'ref &' seems harmless enough to me. As 
> far as getting it to work with templates, the feature is 
> clearly mutually exclusive with 'auto ref', but I'm not sure 
> why any other usage would be a problem.

I like 'ref&' also, but the reaction seemed to imply that it 
looks not like a temp ref, more like a double ref. So we came 
back to '@ref'.
And in terms of 'scope ref': scope works currently only for 
delegates so you could customize the behavior of scope ref quite 
appropriately. 'scope ref' is my second favorite alternative.
The ranking would be:
1. ref&
2. scope ref / ref in
3. @ref

For all of these a proposal and a finished implementation of mine 
is ready, you have to choose and to review only. :)


More information about the Digitalmars-d mailing list