2 ms·
> You could certainly define the `ParitalOrd` trait for the two types to make the comparison possible I don't believe that's possible. Unless something changed
by lomnakkus 9y ago
> You could certainly define the `ParitalOrd` trait for the two types to make the comparison possible
I don't believe that's possible. Unless something changed relatively recently, the trait implementation has to be either a) in the module where the trait itself is defined (so the standard library in this case), or b) in the module where the type you're implementing the trait for is defined (again, the standard library). Since you can just modify the standard library, implementing PartialOrd would not be possible for e.g. comparing u16/s16 (or whatever).