Generic Type Alias

FlattenCollection

No overview available.

Declaration

typealias FlattenCollection<T> = FlattenSequence<T> where T : Collection, T.Element : Collection

Topics

Type Aliases

typealias FlattenCollection.Indices

A type that represents the indices that are valid for subscripting the collection, in ascending order.

Beta
typealias FlattenCollection.SubSequence

A sequence that represents a contiguous subrange of the collection’s elements.

Beta

Instance Properties

var endIndex: FlattenSequence<Base>.Index

The collection’s “past the end” position.

var startIndex: FlattenSequence<Base>.Index

The position of the first element in a non-empty collection.

Instance Methods

func distance(from: FlattenSequence<Base>.Index, to: FlattenSequence<Base>.Index) -> Int

Returns the distance between two indices.

func formIndex(inout FlattenSequence<Base>.Index, offsetBy: Int)
func formIndex(inout FlattenSequence<Base>.Index, offsetBy: Int, limitedBy: FlattenSequence<Base>.Index) -> Bool
func formIndex(after: inout FlattenSequence<Base>.Index)

Replaces the given index with its successor.

func formIndex(before: inout FlattenSequence<Base>.Index)

Replaces the given index with its predecessor.

func index(FlattenSequence<Base>.Index, offsetBy: Int) -> FlattenSequence<Base>.Index

Returns an index that is the specified distance from the given index.

func index(FlattenSequence<Base>.Index, offsetBy: Int, limitedBy: FlattenSequence<Base>.Index) -> FlattenSequence<Base>.Index?

Returns an index that is the specified distance from the given index, unless that distance is beyond a given limiting index.

func index(after: FlattenSequence<Base>.Index) -> FlattenSequence<Base>.Index

Returns the position immediately after the given index.

func index(before: FlattenSequence<Base>.Index) -> FlattenSequence<Base>.Index

Returns the position immediately before the given index.

Subscripts

subscript(FlattenSequence<Base>.Index) -> Base.Element.Element

Accesses the element at position.

subscript(Range<FlattenSequence<Base>.Index>) -> Slice<FlattenCollection<Base>>

Accesses a contiguous subrange of the collection’s elements.

See Also

Wrappers for Algorithms

struct CollectionDifference

A collection of insertions and removals that describe the difference between two ordered collection states.

struct DropFirstSequence

A sequence that lazily consumes and drops n elements from an underlying Base iterator before possibly returning the first available element.

struct DropWhileSequence

A sequence that lazily consumes and drops n elements from an underlying Base iterator before possibly returning the first available element.

struct EnumeratedSequence

An enumeration of the elements of a sequence or collection.

struct FlattenSequence

A sequence consisting of all the elements contained in each segment contained in some Base sequence.

struct JoinedSequence

A sequence that presents the elements of a base sequence of sequences concatenated using a given separator.

struct PrefixSequence

A sequence that only consumes up to n elements from an underlying Base iterator.

struct Repeated

A collection whose elements are all identical.

struct ReversedCollection

A collection that presents the elements of its base collection in reverse order.

struct StrideTo

A sequence of values formed by striding over a half-open interval.

struct StrideThrough

A sequence of values formed by striding over a closed interval.

struct UnfoldSequence

A sequence whose elements are produced via repeated applications of a closure to some mutable state.

struct Zip2Sequence

A sequence of pairs built out of two underlying sequences.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software