We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6647a34 commit d903231Copy full SHA for d903231
src/libstd/priority_queue.rs
@@ -12,6 +12,7 @@
12
13
use core::container::{Container, Mutable};
14
use core::cmp::Ord;
15
+use core::iter::BaseIter;
16
use core::prelude::*;
17
use core::ptr::addr_of;
18
use core::vec;
@@ -26,6 +27,14 @@ pub struct PriorityQueue<T> {
26
27
priv data: ~[T],
28
}
29
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
+
38
impl <T: Ord> PriorityQueue<T>: Container {
39
/// Returns the length of the queue
40
pure fn len(&self) -> uint { self.data.len() }
0 commit comments