what means... auto ref Args args?

Dave Jones dave at jones.com
Thu Oct 19 12:51:52 UTC 2017


On Thursday, 19 October 2017 at 01:05:28 UTC, Jonathan M Davis 
wrote:
> On Thursday, October 19, 2017 00:00:54 Dave Jones via

> That's likely the main reason in this case, since losing the 
> ref-ness could definitely cause issues with some constructors, 
> but auto ref is frequently used simply to avoid copying lvalues 
> while not requiring lvalues (since if ref is used, the argument 
> must be an lvalue, and if ref is not used, the argument will be 
> copied if it's an lvalue; it will be moved if it's an rvalue). 
> D never binds rvalues to ref like C++ does with const T&.
>
> - Jonathan M Davis

Makes sense, thanks.


More information about the Digitalmars-d mailing list