about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorblake2-ppc <blake2-ppc>2013-08-03 21:34:00 +0200
committerblake2-ppc <blake2-ppc>2013-08-06 04:05:08 +0200
commitb5cd81d0e54fb2310ce0de6f746957501130ce5f (patch)
treee3f2971eeadbc37a4f18719b78b0fbf50ca385b0 /src/libstd
parent520f292e48a61538e681ce61d46a58f965c800a1 (diff)
downloadrust-b5cd81d0e54fb2310ce0de6f746957501130ce5f.tar.gz
rust-b5cd81d0e54fb2310ce0de6f746957501130ce5f.zip
std: Improve the documentation for iterator::Invert
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/iterator.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs
index bf55b4f7ce2..56a0dca5667 100644
--- a/src/libstd/iterator.rs
+++ b/src/libstd/iterator.rs
@@ -82,6 +82,17 @@ pub trait DoubleEndedIteratorUtil {
 /// In the future these will be default methods instead of a utility trait.
 impl<A, T: DoubleEndedIterator<A>> DoubleEndedIteratorUtil for T {
     /// Flip the direction of the iterator
+    ///
+    /// The inverted iterator flips the ends on an iterator that can already
+    /// be iterated from the front and from the back.
+    ///
+    ///
+    /// If the iterator also implements RandomAccessIterator, the inverted
+    /// iterator is also random access, with the indices starting at the back
+    /// of the original iterator.
+    ///
+    /// Note: Random access with inverted indices still only applies to the first
+    /// `uint::max_value` elements of the original iterator.
     #[inline]
     fn invert(self) -> Invert<T> {
         Invert{iter: self}