RangeGenerator

struct RangeGenerator<T : ForwardIndexType>

A generator over the elements of Range<T>

Inheritance GeneratorType, SequenceType, _SequenceType, _Sequence_Type View Protocol Hierarchy →
Associated Types
Element = T

The type of element returned by next().

Generator = RangeGenerator<T>

A type whose instances can produce the elements of this sequence, in order.

Import import Swift

Initializers

init(_:)

Construct an instance that traverses the elements of bounds

Declaration

init(_ bounds: Range<T>)

Instance Variables

var endIndex: T

The upper bound of the remaining range; not included in the generated sequence.

Declaration

var endIndex: T { get set }
var startIndex: T

The lower bound of the remaining range.

Declaration

var startIndex: T { get set }

Instance Methods

func generate()

RangeGenerator is also a SequenceType, so it generate's a copy of itself

Declaration

func generate() -> RangeGenerator<T>
mutating func next()

Advance to the next element and return it, or nil if no next element exists.

Declaration

mutating func next() -> T?