Macro konst::max

source ·
macro_rules! max {
    ($left:expr, $right:expr) => { ... };
}
Expand description

Const equivalent of std::cmp::max

The arguments must implement the ConstCmp trait. Non-standard library types must define a const_eq method taking a reference.

Returns the $right argument if both compare equal.

§Example

const M: &str = konst::max!("world", "hello");
assert_eq!(M, "world");