Function lib::util::other::chmax

source ·
pub fn chmax<T: PartialOrd>(mn: &mut T, n: T) -> bool
Expand description

Update mn = max(mn, n), and return if mn was updated.

§Examples

use lib::util::other::chmax;
let mut mn = -998244353;
if chmax(&mut mn, 3) {}