std: implement Total{Ord,Eq} for pointers.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
//! Operations on unique pointer types
|
||||
|
||||
#[cfg(not(test))] use cmp::{Eq, Ord};
|
||||
#[cfg(not(test))] use cmp::*;
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<T:Eq> Eq for ~T {
|
||||
@@ -31,3 +31,15 @@ impl<T:Ord> Ord for ~T {
|
||||
#[inline]
|
||||
fn gt(&self, other: &~T) -> bool { *(*self) > *(*other) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<T: TotalOrd> TotalOrd for ~T {
|
||||
#[inline]
|
||||
fn cmp(&self, other: &~T) -> Ordering { (**self).cmp(*other) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<T: TotalEq> TotalEq for ~T {
|
||||
#[inline]
|
||||
fn equals(&self, other: &~T) -> bool { (**self).equals(*other) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user