use assoc types in binop traits
This commit is contained in:
parent
7095dd0070
commit
99017f82b6
36 changed files with 375 additions and 156 deletions
|
@ -127,9 +127,9 @@ pub fn abs_sub<T: FloatMath>(x: T, y: T) -> T {
|
|||
#[cfg(test)]
|
||||
pub fn test_num<T>(ten: T, two: T) where
|
||||
T: PartialEq + NumCast
|
||||
+ Add<T, T> + Sub<T, T>
|
||||
+ Mul<T, T> + Div<T, T>
|
||||
+ Rem<T, T> + Show
|
||||
+ Add<Output=T> + Sub<Output=T>
|
||||
+ Mul<Output=T> + Div<Output=T>
|
||||
+ Rem<Output=T> + Show
|
||||
+ Copy
|
||||
{
|
||||
assert_eq!(ten.add(two), cast(12i).unwrap());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue