structs are now lvalues - what is with "auto ref"?

Namespace rswhite4 at googlemail.com
Sat Dec 29 10:59:35 PST 2012


On Saturday, 29 December 2012 at 18:43:37 UTC, Minas Mina wrote:
> So when it will be fixed I will be able to write:
>
> void foo(auto ref Vector3 v);
>
> and it will pass copies or references depending on the 
> situation?

Yes. The compiler generates the function for the specific 
situation.
So you have in the worst case 2^n permutations of the function.
See also my implementation in Remus/Romulus. This generates 
actually _all_ permutations.


More information about the Digitalmars-d-learn mailing list