var Sequence.enumerated => func

This commit is contained in:
Dmitri Gribenko
2015-11-20 18:04:03 -08:00
committed by Max Moiseev
parent 5ccc258f71
commit 06577273e9
10 changed files with 29 additions and 29 deletions

View File

@@ -62,7 +62,7 @@ public func max<T : Comparable>(x: T, _ y: T, _ z: T, _ rest: T...) -> T {
/// starting at zero, along with the elements of the underlying
/// `Base`:
///
/// var iterator = ["foo", "bar"].enumerated.iterator()
/// var iterator = ["foo", "bar"].enumerated().iterator()
/// iterator.next() // (0, "foo")
/// iterator.next() // (1, "bar")
/// iterator.next() // nil
@@ -94,13 +94,13 @@ public struct EnumeratedIterator<
}
}
/// The type of the `enumerated` property.
/// The type of the `enumerated()` property.
///
/// `EnumeratedSequence` is a sequence of pairs (*n*, *x*), where *n*s
/// are consecutive `Int`s starting at zero, and *x*s are the elements
/// of a `Base` `Sequence`:
///
/// var s = ["foo", "bar"].enumerated
/// var s = ["foo", "bar"].enumerated()
/// Array(s) // [(0, "foo"), (1, "bar")]
public struct EnumeratedSequence<Base : Sequence> : Sequence {
internal var _base: Base