use super::basic::{Z0, P1, N1, B0, B1, NonNegOne, NonZero};
pub trait IfB0 {
type Output;
fn b0() -> Self::Output;
}
pub trait IfB1 {
type Output;
fn b1() -> Self::Output;
}
impl<I: NonZero> IfB0 for I {
type Output = B0<I>;
#[inline(always)]
fn b0() -> Self::Output {
B0::new()
}
}
impl IfB0 for Z0 { type Output = Z0;
#[inline(always)]
fn b0() -> Self::Output {
Z0::new()
}
}
impl<I: NonZero + NonNegOne> IfB1 for I {
type Output = B1<I>;
#[inline(always)]
fn b1() -> Self::Output {
B1::new()
}
}
impl IfB1 for N1 { type Output = N1;
#[inline(always)]
fn b1() -> Self::Output {
N1::new()
}
}
impl IfB1 for Z0 { type Output = P1;
#[inline(always)]
fn b1() -> Self::Output {
P1::new()
}
}