macro_rules! forward_ref_binop {
(impl$(<$(const $c:ident: $i:ty),+>)? const $imp:ident<$u:ty>, $method:ident for $t:ty) => {
impl$(<'a, $(const $c: $i,)+>)? const $imp<$u> for &'a $t {
type Output = <$t as $imp<$u>>::Output;
#[inline]
fn $method(self, rhs: $u) -> <$t as $imp<$u>>::Output {
$imp::$method(*self, rhs)
}
}
impl$(<$(const $c: $i,)+>)? const $imp<&$u> for $t {
type Output = <$t as $imp<$u>>::Output;
#[inline]
fn $method(self, rhs: &$u) -> <$t as $imp<$u>>::Output {
$imp::$method(self, *rhs)
}
}
impl$(<$(const $c: $i,)+>)? const $imp<&$u> for &$t {
type Output = <$t as $imp<$u>>::Output;
#[inline]
fn $method(self, rhs: &$u) -> <$t as $imp<$u>>::Output {
$imp::$method(*self, *rhs)
}
}
};
(impl$(<$(const $c:ident: $i:ty),+>)? $imp:ident<$u:ty>, $method:ident for $t:ty) => {
impl$(<'a, $(const $c: $i,)+>)? $imp<$u> for &'a $t {
type Output = <$t as $imp<$u>>::Output;
#[inline]
fn $method(self, rhs: $u) -> <$t as $imp<$u>>::Output {
$imp::$method(*self, rhs)
}
}
impl$(<$(const $c: $i,)+>)? $imp<&$u> for $t {
type Output = <$t as $imp<$u>>::Output;
#[inline]
fn $method(self, rhs: &$u) -> <$t as $imp<$u>>::Output {
$imp::$method(self, *rhs)
}
}
impl$(<$(const $c: $i,)+>)? $imp<&$u> for &$t {
type Output = <$t as $imp<$u>>::Output;
#[inline]
fn $method(self, rhs: &$u) -> <$t as $imp<$u>>::Output {
$imp::$method(*self, *rhs)
}
}
};
}
macro_rules! forward_ref_op_assign {
(impl$(<$(const $c:ident: $i:ty),+>)? const $imp:ident<$u:ty>, $method:ident for $t:ty) => {
impl$(<$(const $c: $i,)+>)? const $imp<&$u> for $t {
#[inline]
fn $method(&mut self, rhs: &$u) {
$imp::$method(self, *rhs);
}
}
};
(impl$(<$(const $c:ident: $i:ty),+>)? $imp:ident<$u:ty>, $method:ident for $t:ty) => {
impl$(<$(const $c: $i,)+>)? $imp<&$u> for $t {
#[inline]
fn $method(&mut self, rhs: &$u) {
$imp::$method(self, *rhs);
}
}
};
}