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)

Reply via email to