|
@@ -118,7 +118,7 @@ macro_rules! forward_scalar_val_val_binop_commutative {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-macro_rules! forward_scalar_val_ref_binop_commutative {
|
|
|
|
|
|
+macro_rules! forward_scalar_val_ref_binop {
|
|
(impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => {
|
|
(impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => {
|
|
impl<'a> $imp<&'a $scalar> for $res {
|
|
impl<'a> $imp<&'a $scalar> for $res {
|
|
type Output = $res;
|
|
type Output = $res;
|
|
@@ -134,13 +134,13 @@ macro_rules! forward_scalar_val_ref_binop_commutative {
|
|
|
|
|
|
#[inline]
|
|
#[inline]
|
|
fn $method(self, other: $res) -> $res {
|
|
fn $method(self, other: $res) -> $res {
|
|
- $imp::$method(other, *self)
|
|
|
|
|
|
+ $imp::$method(*self, other)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-macro_rules! forward_scalar_ref_val_binop_commutative {
|
|
|
|
|
|
+macro_rules! forward_scalar_ref_val_binop {
|
|
(impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => {
|
|
(impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => {
|
|
impl<'a> $imp<$scalar> for &'a $res {
|
|
impl<'a> $imp<$scalar> for &'a $res {
|
|
type Output = $res;
|
|
type Output = $res;
|
|
@@ -156,13 +156,13 @@ macro_rules! forward_scalar_ref_val_binop_commutative {
|
|
|
|
|
|
#[inline]
|
|
#[inline]
|
|
fn $method(self, other: &$res) -> $res {
|
|
fn $method(self, other: &$res) -> $res {
|
|
- $imp::$method(other.clone(), self)
|
|
|
|
|
|
+ $imp::$method(self, other.clone())
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-macro_rules! forward_scalar_ref_ref_binop_commutative {
|
|
|
|
|
|
+macro_rules! forward_scalar_ref_ref_binop {
|
|
(impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => {
|
|
(impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => {
|
|
impl<'a, 'b> $imp<&'b $scalar> for &'a $res {
|
|
impl<'a, 'b> $imp<&'b $scalar> for &'a $res {
|
|
type Output = $res;
|
|
type Output = $res;
|
|
@@ -178,7 +178,7 @@ macro_rules! forward_scalar_ref_ref_binop_commutative {
|
|
|
|
|
|
#[inline]
|
|
#[inline]
|
|
fn $method(self, other: &$res) -> $res {
|
|
fn $method(self, other: &$res) -> $res {
|
|
- $imp::$method(other.clone(), *self)
|
|
|
|
|
|
+ $imp::$method(*self, other.clone())
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -211,11 +211,17 @@ macro_rules! forward_all_binop_to_val_ref_commutative {
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+macro_rules! forward_all_scalar_binop_to_val_val {
|
|
|
|
+ (impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => {
|
|
|
|
+ forward_scalar_val_ref_binop!(impl $imp<$scalar> for $res, $method);
|
|
|
|
+ forward_scalar_ref_val_binop!(impl $imp<$scalar> for $res, $method);
|
|
|
|
+ forward_scalar_ref_ref_binop!(impl $imp<$scalar> for $res, $method);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
macro_rules! forward_all_scalar_binop_to_val_val_commutative {
|
|
macro_rules! forward_all_scalar_binop_to_val_val_commutative {
|
|
(impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => {
|
|
(impl $imp:ident<$scalar:ty> for $res:ty, $method:ident) => {
|
|
forward_scalar_val_val_binop_commutative!(impl $imp<$scalar> for $res, $method);
|
|
forward_scalar_val_val_binop_commutative!(impl $imp<$scalar> for $res, $method);
|
|
- forward_scalar_val_ref_binop_commutative!(impl $imp<$scalar> for $res, $method);
|
|
|
|
- forward_scalar_ref_val_binop_commutative!(impl $imp<$scalar> for $res, $method);
|
|
|
|
- forward_scalar_ref_ref_binop_commutative!(impl $imp<$scalar> for $res, $method);
|
|
|
|
|
|
+ forward_all_scalar_binop_to_val_val!(impl $imp<$scalar> for $res, $method);
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|