[][src]Trait ranged_num::AddU

pub trait AddU<U> where
    U: Unsigned
{ type Output; }

typenum doesn't currently allow you to easily add an Integer with an Unsigned. The AddU trait lets you add some Unsigned to both Integers and Unsigneds.

Example:

use typenum::*;
use ranged_num::AddU;
 
assert_type_eq!(<U6 as AddU<U3>>::Output, U9);
assert_type_eq!(<P6 as AddU<U3>>::Output, P9);
assert_type_eq!(<N6 as AddU<U3>>::Output, N3);

Associated Types

Loading content...

Implementations on Foreign Types

impl<U, B, T> AddU<T> for UInt<U, B> where
    T: Unsigned,
    UInt<U, B>: Add<T>, 
[src]

type Output = <UInt<U, B> as Add<T>>::Output

impl<U, T> AddU<T> for PInt<U> where
    T: Unsigned + NonZero,
    U: Unsigned + NonZero,
    PInt<U>: Add<PInt<T>>, 
[src]

type Output = <PInt<U> as Add<PInt<T>>>::Output

impl<U, T> AddU<T> for NInt<U> where
    T: Unsigned + NonZero,
    U: Unsigned + NonZero,
    NInt<U>: Add<PInt<T>>, 
[src]

type Output = <NInt<U> as Add<PInt<T>>>::Output

Loading content...

Implementors

Loading content...