rust/src/libcore/iter-trait/dvec.rs
2012-05-18 20:00:50 -07:00

17 lines
367 B
Rust

type IMPL_T<A> = dvec::dvec<A>;
#[doc = "
Iterates through the current contents.
Attempts to access this dvec during iteration will fail.
"]
fn EACH<A>(self: IMPL_T<A>, f: fn(A) -> bool) {
import dvec::extensions;
self.swap { |v| vec::each(v, f); v }
}
fn SIZE_HINT<A>(self: IMPL_T<A>) -> option<uint> {
import dvec::extensions;
some(self.len())
}