Function fera_fun::position_max_by_key
[−]
[src]
pub fn position_max_by_key<I, F, X>(iter: I, f: F) -> Option<usize> where
I: IntoIterator,
X: Ord,
F: FnMut(&I::Item) -> X,
Returns the last position of the maximum element of a non empty iterator or None
if iterator
is empty.
use fera_fun::position_max_by_key; assert_eq!(Some(4), position_max_by_key(&[0i32, 3, -5, 0, 5], |x| x.abs()));