rust/src/libcore/iter-trait/dvec.rs
2012-08-26 15:56:16 -07:00

15 lines
365 B
Rust

#[allow(non_camel_case_types)]
type IMPL_T<A> = dvec::DVec<A>;
/**
* Iterates through the current contents.
*
* Attempts to access this dvec during iteration will fail.
*/
pure fn EACH<A>(self: IMPL_T<A>, f: fn(A) -> bool) {
unsafe { self.swap(|v| { vec::each(v, f); v }) }
}
pure fn SIZE_HINT<A>(self: IMPL_T<A>) -> Option<uint> {
Some(self.len())
}