rust/src/libcore/iter-trait/dvec.rs

16 lines
365 B
Rust
Raw Normal View History

2012-08-14 18:54:13 -05:00
#[allow(non_camel_case_types)]
type IMPL_T<A> = dvec::DVec<A>;
2012-05-09 19:30:31 -05:00
/**
* 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 }) }
2012-05-09 19:30:31 -05:00
}
pure fn SIZE_HINT<A>(self: IMPL_T<A>) -> option<uint> {
2012-05-09 19:30:31 -05:00
some(self.len())
}