'Auto can only be used for template function arguments' what?
Mehrdad
wfunction at hotmail.com
Tue Jun 26 22:02:28 PDT 2012
On Wednesday, 27 June 2012 at 04:26:08 UTC, Jonathan M Davis
wrote:
> And how would that work? auto ref duplicates the function. If
> you pass it an lvalue, then it generates a ref version.
Two solutions:
- Turn 'auto ref' into 'ref', but simply have the compiler
generate a copy for the caller if he wants to pass by value?
- Treat it as though it were a templated parameter. Why does it
make any difference here?
More information about the Digitalmars-d
mailing list