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

15 lines
313 B
Rust
Raw Normal View History

2012-05-09 19:30:31 -05:00
type IMPL_T<A> = dvec::dvec<A>;
/**
* Iterates through the current contents.
*
* Attempts to access this dvec during iteration will fail.
*/
2012-05-09 19:30:31 -05:00
fn EACH<A>(self: IMPL_T<A>, f: fn(A) -> bool) {
2012-06-30 18:19:07 -05:00
self.swap(|v| { vec::each(v, f); v })
2012-05-09 19:30:31 -05:00
}
fn SIZE_HINT<A>(self: IMPL_T<A>) -> option<uint> {
some(self.len())
}