https://github.com/labath commented:
I don't think this usage of rvalue references is very idiomatic. It saves an
object copy (move), but:
- that should be very cheap anyway
- it increases the risk of improper handling and weird side-effects -- a
function like `void use(Error E) {}` will always crash at the closing bracket
(due to not checking the error), but `use(Error &&E){}` will never crash
*inside* the function (because it doesn't own the error), and whether the
program as a whole crashes depends on whether the caller does any other
operation that would clear the error object.
So, I think it would be better to stick to value semantics. Other than that,
this seems fine.
https://github.com/llvm/llvm-project/pull/107163
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits