1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#![feature(op_assign_traits)]

use std::default::*;
use std::marker::Send;
use std::ops::*;

mod abs;
mod ident;

pub use abs::*;
pub use ident::*;

pub trait Scalar:
    Copy
    + Send
    + PartialEq
    + PartialOrd
    + Default
    + Zero
    + One
    + Add<Self, Output = Self>
    + AddAssign<Self>
    + Sub<Self, Output = Self>
    + SubAssign<Self>
    + Mul<Self, Output = Self>
    + MulAssign<Self>
    + Div<Self, Output = Self>
    + DivAssign<Self>
    + Rem<Self, Output = Self>
    + RemAssign<Self>
    + Neg<Output = Self>
    + Abs
{
}

impl<S> Scalar for S
where
    S: Copy
        + Send
        + PartialEq
        + PartialOrd
        + Default
        + Zero
        + One
        + Add<S, Output = S>
        + AddAssign<S>
        + Sub<S, Output = S>
        + SubAssign<S>
        + Mul<S, Output = S>
        + MulAssign<S>
        + Div<S, Output = S>
        + DivAssign<S>
        + Rem<S, Output = S>
        + RemAssign<S>
        + Neg<Output = S>
        + Abs,
{
}