Description
Writing generic code over numeric types is hard in Rust right now. One has to add additional bounds like Clone, Copy or a whole bunch of for<'a> &'a T: for <'b> Add<&'b T, Output=T>
bounds (for various combinations of references, non-references and operators) to support "non-consuming" versions of arithmetic operators.
What do you guys and gals think about adding those "non-consuming operators" to the Num
trait? I added these kinds of operator implementations for the built-in types in the standard library for that reason in consultation with @aturon . Addings these requirements to the Num
trait would make the life of a numeric type provider a little harder but we still have macros that ease the pain. It would be a great benefit for generic numeric code in that "T: Num" is much less noisy than "T: Num + for<'b> Add<&'b T, Output=T> + …` etc.