You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue was labelled with: A-iterators, A-libs, B-RFC in the Rust repository
It would be handy if Iterator::min_by required PartialOrd instead of Ord. This requirement makes it impossible to use with among other common types f32 and f64, which is annoying. I don't know if the best solution is to simply change the required trait to PartialOrd or to provide some other method min_by_partial_ord or something along those lines. The same reasoning should apply to Iterator::max_by
The text was updated successfully, but these errors were encountered:
Possible revisions to max_by and min_by that would make this problem go away are being discussed in Rust issue 15311. Summary: "scoring" functions like the one expected by max_by have disadvantages; expecting a function that does the comparison and returns a bool or Ordering might work better.
Tuesday Sep 30, 2014 at 06:15 GMT
For earlier discussion, see rust-lang/rust#17648
This issue was labelled with: A-iterators, A-libs, B-RFC in the Rust repository
It would be handy if Iterator::min_by required PartialOrd instead of Ord. This requirement makes it impossible to use with among other common types f32 and f64, which is annoying. I don't know if the best solution is to simply change the required trait to PartialOrd or to provide some other method min_by_partial_ord or something along those lines. The same reasoning should apply to Iterator::max_by
The text was updated successfully, but these errors were encountered: