16 lines
370 B
Rust
Raw Normal View History

2012-08-14 16:54:13 -07:00
#[allow(non_camel_case_types)]
type IMPL_T<A> = dvec::DVec<A>;
2012-05-09 17:30:31 -07: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); move v }) }
2012-05-09 17:30:31 -07:00
}
2012-08-20 12:23:37 -07:00
pure fn SIZE_HINT<A>(self: IMPL_T<A>) -> Option<uint> {
Some(self.len())
2012-05-09 17:30:31 -07:00
}