On 11/06/14 01:54 PM, Tommi wrote: > If the `Mul` trait and similar were changed to take `self` by value, perhaps > the following kind of language design would make more sense: > > If a variable of a type that has a destructor is passed to a function by > value (moved), and the variable is used after the function call, the variable > would be implicitly cloned before passing it to the function.
Cloning big integers, rationals based on big integers or arbitrary precision floating point values for every single operation has a high cost. One of Rust's strength's is that it doesn't have implicit cloning as C++ does due to copy constructors.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev