Add an iter2 iterator to vec.

This commit is contained in:
Michael Sullivan 2011-08-19 16:14:38 -07:00
parent 56c8d16326
commit 84a6b888c0

View File

@ -307,6 +307,14 @@ fn reversed<@T>(v: &[T]) -> [T] {
ret rs;
}
// Iterate over a list with with the indexes
iter iter2<@T>(v: &[T]) -> (uint, T) {
let i = 0u;
for x in v {
put (i, x);
i += 1u;
}
}
mod unsafe {
type ivec_repr =