Trait dialectic::unary::Compare[][src]

pub trait Compare<IfLess, IfEqual, IfGreater>: Compare {
    type Result;
}

Compare two unary numbers and branch on their comparison, at the type level.

Examples

use dialectic::prelude::*;
use dialectic::unary::{Compare, UnaryOf};
use static_assertions::assert_type_eq_all;

assert_type_eq_all!(<(UnaryOf<0>, UnaryOf<1>) as Compare<u8, u16, u32>>::Result, u8);
assert_type_eq_all!(<(UnaryOf<1>, UnaryOf<1>) as Compare<u8, u16, u32>>::Result, u16);
assert_type_eq_all!(<(UnaryOf<2>, UnaryOf<1>) as Compare<u8, u16, u32>>::Result, u32);

Associated Types

type Result[src]

The result of the comparison: either T if Self == N or E if Self != N.

Loading content...

Implementations on Foreign Types

impl<N: Unary, M: Unary, IfLess, IfEqual, IfGreater> Compare<IfLess, IfEqual, IfGreater> for (S<N>, S<M>) where
    (N, M): Compare<IfLess, IfEqual, IfGreater>, 
[src]

type Result = <(N, M) as Compare<IfLess, IfEqual, IfGreater>>::Result

impl<IfLess, IfEqual, IfGreater> Compare<IfLess, IfEqual, IfGreater> for (Z, Z)[src]

type Result = IfEqual

impl<N: Unary, IfLess, IfEqual, IfGreater> Compare<IfLess, IfEqual, IfGreater> for (S<N>, Z)[src]

type Result = IfGreater

impl<N: Unary, IfLess, IfEqual, IfGreater> Compare<IfLess, IfEqual, IfGreater> for (Z, S<N>)[src]

type Result = IfLess

Loading content...

Implementors

Loading content...