use super::super::pre::Cast; pub trait Tuple2 { fn get(self) -> (R, R); } impl Tuple2 for (A, B) where (R, R): Cast, { fn get(self) -> (R, R) { <_>::to(self) } } impl Tuple2 for T where (R, R): Cast<(T, T)>, { fn get(self) -> (R, R) { <_>::to((self, self)) } } pub trait Tuple3 { fn get(self) -> (R, R, R); } impl Tuple3 for (A, B, C) where (R, R, R): Cast, { fn get(self) -> (R, R, R) { <_>::to(self) } } impl Tuple3 for T where (R, R, R): Cast<(T, T, T)>, { fn get(self) -> (R, R, R) { <_>::to((self, self, self)) } } pub trait Tuple4 { fn get(self) -> (R, R, R, R); } impl Tuple4 for (A, B, C, D) where (R, R, R, R): Cast, { fn get(self) -> (R, R, R, R) { <_>::to(self) } } impl Tuple4 for T where (R, R, R, R): Cast<(T, T, T, T)>, { fn get(self) -> (R, R, R, R) { <_>::to((self, self, self, self)) } } pub trait TupleA { fn get(self) -> [R; N]; } impl TupleA for [T; N] where [R; N]: Cast, { fn get(self) -> [R; N] { <_>::to(self) } } impl TupleA for T where R: Cast, { fn get(self) -> [R; N] { [self; N].map(|x| R::to(x)) } } trait_alias!(pub(super) ToZero, Cast + Copy + Default);