File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
branches/dist-snap/src/libstd Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9
9
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10
- refs/heads/dist-snap: 5573ad723fc73197889f5890dc9846ba107757d9
10
+ refs/heads/dist-snap: 8f840f9ea0a60e05d3d587d64c9e178c0af1e227
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export le;
9
9
export merge_sort;
10
10
export quick_sort;
11
11
export quick_sort3;
12
+ export Sort ;
12
13
13
14
type le < T > = pure fn( v1 : & T , v2 : & T ) -> bool ;
14
15
@@ -160,6 +161,14 @@ fn quick_sort3<T: copy Ord Eq>(arr: &[mut T]) {
160
161
qsort3 ( arr, 0 , ( arr. len ( ) - 1 ) as int ) ;
161
162
}
162
163
164
+ trait Sort {
165
+ fn qsort ( self ) ;
166
+ }
167
+
168
+ impl < T : copy Ord Eq > & [ mut T ] : Sort {
169
+ fn qsort ( self ) { quick_sort3 ( self ) ; }
170
+ }
171
+
163
172
#[ cfg( test) ]
164
173
mod test_qsort3 {
165
174
fn check_sort ( v1 : & [ mut int] , v2 : & [ mut int] ) {
You can’t perform that action at this time.
0 commit comments