On 4/10/12 1:41 AM, Nick Sabalausky wrote:
No, not when it sees:

void foo(ref T t) { ... }

It's when it sees:

void foo(auto ref T t) { ... }

Yah, I think this could work, but I'm not 100% sure.

So auto ref in a template function means "generate code appropriately with or without ref".

Now, if a function is NOT a template, we could have a completely different approach to the same issue. In that context, "auto ref" might mean "I don't care, just accept references to rvalues too!"

That would take care of the matter. It's different from the C++ rule because the user can still overload on ref and rvalue if they need the distinction, and "auto ref" offers an explicit (not implicit) route to achieving "I don't care".


Andrei


_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta

Reply via email to