[stdlib] Add a default generate() for generators...

...that are also sequences, and rip out all redundant implementations of
generate() that match a default.

Swift SVN r30035
This commit is contained in:
Dave Abrahams
2015-07-09 19:49:24 +00:00
parent 92936de2ed
commit 913f09838a
12 changed files with 8 additions and 80 deletions

View File

@@ -212,16 +212,6 @@ public struct EnumerateGenerator<
if b == nil { return .None }
return .Some((index: count++, element: b!))
}
/// A type whose instances can produce the elements of this
/// sequence, in order.
public typealias Generator = EnumerateGenerator<Base>
/// `EnumerateGenerator` is also a `SequenceType`, so it
/// `generate`s a copy of itself.
public func generate() -> Generator {
return self
}
}
/// The `SequenceType` returned by `enumerate()`. `EnumerateSequence`