num-traits
num-traits copied to clipboard
Require std::iter::Sum for Float
Would it be possible to require std::iter::Sum for Float or maybe for Num?
Right now I cannot .sum() an iterator over T: Float.
It would be a breaking change to add that requirement to existing traits.
You could use T: Float + Sum, or make your own meta-trait:
trait MyFloat: Float + Sum {}
impl<T: Float + Sum> MyFloat for T {}