Skip to content

Commit 3aa4166

Browse files
committed
---
yaml --- r: 42366 b: refs/heads/master c: d903231 h: refs/heads/master v: v3
1 parent ddf64a4 commit 3aa4166

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 6647a3402bf75368de1a692370c558d423f36940
2+
refs/heads/master: d903231f1e7d7efb35405bdfdcbc451385e429b2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/src/libstd/priority_queue.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
1313
use core::container::{Container, Mutable};
1414
use core::cmp::Ord;
15+
use core::iter::BaseIter;
1516
use core::prelude::*;
1617
use core::ptr::addr_of;
1718
use core::vec;
@@ -26,6 +27,14 @@ pub struct PriorityQueue<T> {
2627
priv data: ~[T],
2728
}
2829

30+
impl <T: Ord> PriorityQueue<T>: BaseIter<T> {
31+
/// Visit all values in the underlying vector.
32+
///
33+
/// The values are **not** visited in order.
34+
pure fn each(&self, f: fn(&T) -> bool) { self.data.each(f) }
35+
pure fn size_hint(&self) -> Option<uint> { self.data.size_hint() }
36+
}
37+
2938
impl <T: Ord> PriorityQueue<T>: Container {
3039
/// Returns the length of the queue
3140
pure fn len(&self) -> uint { self.data.len() }

0 commit comments

Comments
 (0)