rvalue references

Namespace rswhite4 at googlemail.com
Wed Apr 24 23:13:57 PDT 2013


What I ask me for some time:
Would it not be possible that a method such as
----
void foo (auto ref A a) {}
----
In such a call:
----
foo (A (42));
----
move the argument, and in a case like this
----
A a = 42;
/ / ...
foo (a);
----
gets the argument by ref? And that without to double the function 
2^n times?
Purely out of interest. Because that would actually (as far as I 
can see) the optimal solution.


More information about the Digitalmars-d mailing list