diff --git a/src/libstd/priority_queue.rs b/src/libstd/priority_queue.rs index fcd9f8379b2f..5248ab1742eb 100644 --- a/src/libstd/priority_queue.rs +++ b/src/libstd/priority_queue.rs @@ -12,6 +12,7 @@ use core::container::{Container, Mutable}; use core::cmp::Ord; +use core::iter::BaseIter; use core::prelude::*; use core::ptr::addr_of; use core::vec; @@ -26,6 +27,14 @@ pub struct PriorityQueue { priv data: ~[T], } +impl PriorityQueue: BaseIter { + /// Visit all values in the underlying vector. + /// + /// The values are **not** visited in order. + pure fn each(&self, f: fn(&T) -> bool) { self.data.each(f) } + pure fn size_hint(&self) -> Option { self.data.size_hint() } +} + impl PriorityQueue: Container { /// Returns the length of the queue pure fn len(&self) -> uint { self.data.len() }