[stdlib] Propagate GeneratorType docs to models

Swift SVN r22208
This commit is contained in:
Dave Abrahams
2014-09-23 09:47:26 +00:00
parent d4de1bf5e9
commit 76f9313088
15 changed files with 77 additions and 7 deletions

View File

@@ -39,7 +39,7 @@ public protocol BooleanType {
/// Also, the generators must be obtained by distinct calls to the
/// *sequence's* `generate()` method, rather than by copying.
public protocol GeneratorType {
/// The type of element to be bound to the loop variable.
/// The type of element generated by `self`.
typealias Element
/// Advance to the next element and return it, or `nil` if no next
@@ -170,6 +170,12 @@ public struct GeneratorSequence<
_base = base
}
/// Advance to the next element and return it, or `nil` if no next
/// element exists.
///
/// Requires: `next()` has not been applied to a copy of `self`
/// since the copy was made, and no preceding call to `self.next()`
/// has returned `nil`.
public mutating func next() -> G.Element? {
return _base.next()
}