Trait typenum::type_operators::Cmp [−][src]
pub trait Cmp<Rhs = Self> { type Output; }
Expand description
A type operator for comparing Self
and Rhs
. It provides a similar functionality to
the function
core::cmp::Ord::cmp
but for types.
Example
use typenum::{Cmp, Ord, N3, P2, P5}; use std::cmp::Ordering; assert_eq!(<P2 as Cmp<N3>>::Output::to_ordering(), Ordering::Greater); assert_eq!(<P2 as Cmp<P2>>::Output::to_ordering(), Ordering::Equal); assert_eq!(<P2 as Cmp<P5>>::Output::to_ordering(), Ordering::Less);
Associated Types
Implementors
impl<Ul: Unsigned, Ur: Unsigned> Cmp<UInt<Ur, B0>> for UInt<Ul, B0> where
Ul: PrivateCmp<Ur, Equal>,
impl<Ul: Unsigned, Ur: Unsigned> Cmp<UInt<Ur, B0>> for UInt<Ul, B1> where
Ul: PrivateCmp<Ur, Greater>,