DIP 36: Rvalue References
Diggory
diggsey at googlemail.com
Tue Apr 23 11:42:53 PDT 2013
In that example you could make opOpAssign take a "const ref" and
then the compiler could see that it could not return that
parameter, but this is slightly hacky and I can see how there may
be obscure corner cases where the rules are not sufficient.
Actually this could also be solved by using the (original)
meaning of "scope" to mark parameters that are not going to be
returned. (I still think both "ref" and "scope ref" should accept
rvalues)
More information about the Digitalmars-d
mailing list