]> git.lizzy.rs Git - rust.git/commit
iterator: add DoubleEndedIterator concept
authorDaniel Micay <danielmicay@gmail.com>
Thu, 11 Jul 2013 04:23:59 +0000 (00:23 -0400)
committerDaniel Micay <danielmicay@gmail.com>
Thu, 11 Jul 2013 05:31:01 +0000 (01:31 -0400)
commitfd5f8d90c5cc593e6aa43a978a1498f88558cc39
tree919f89db73b4b4436bd55827e43a759dae1ae6b3
parent90db8628c548537f453f33e6d253f1392d044e60
iterator: add DoubleEndedIterator concept

This implements the trait for vector iterators, replacing the reverse
iterator types. The methods will stay, for implementing the future
reverse Iterable traits and convenience.

This can also be trivially implemented for circular buffers and other
variants of arrays like strings and `SmallIntMap`/`SmallIntSet`.

The `DoubleEndedIterator` trait will allow for implementing algorithms
like in-place reverse on generic mutable iterators.

The naming (`Range` vs. `Iterator`, `Bidirectional` vs. `DoubleEnded`)
can be bikeshedded in the future.
src/libstd/iterator.rs
src/libstd/vec.rs