On 2014-06-11, at 21:33, Daniel Micay <[email protected]> wrote: > Cloning big integers, rationals based on big integers or arbitrary > precision floating point values for every single operation has a high > cost.
I didn't say that all functions should start taking their arguments by value. I said `Mul` and similar should do it, i.e. functions that take a variable and return a variable of that same type. Instead of passing by reference and making a clone of the passed reference inside those functions, you force the caller to make the clone and mutate the passed argument in place. This enables the C++ like rvalue reference optimization for functions like multiplication.
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
