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
|
|
|
|
2012-07-04 22:53:12 +01:00
|
|
|
/**
|
|
|
|
* Iterates through the current contents.
|
|
|
|
*
|
|
|
|
* Attempts to access this dvec during iteration will fail.
|
|
|
|
*/
|
2012-08-23 10:22:14 -07:00
|
|
|
pure fn EACH<A>(self: IMPL_T<A>, f: fn(A) -> bool) {
|
2012-09-18 18:31:59 -07:00
|
|
|
unsafe {
|
|
|
|
do 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
|
|
|
}
|