CollectionWrapping

public protocol CollectionWrapping : Collection

CollectionWrapping is a type-erasing protocol that allows a Collection-conforming structure to wrap any underlying Collection implementation.

As a result, all of the Collection boilerplate is done for free.

Associated Types

  • Wrapped Collection-conforming type.

    Declaration

    Swift

    associatedtype Base : Collection

Instance Properties

  • Wrapped Collection-conforming type.

    Declaration

    Swift

    var base: Base { get }

Collection

  • startIndex Extension method

    Start index.

    Declaration

    Swift

    public var startIndex: Base.Index { get }
  • endIndex Extension method

    End index.

    Declaration

    Swift

    public var endIndex: Base.Index { get }
  • index(after:) Extension method

    Index after given index i.

    Declaration

    Swift

    public func index(after i: Base.Index) -> Base.Index
  • subscript(_:) Extension method

    Declaration

    Swift

    public subscript(index: Base.Index) -> Base.Element { get }

    Return Value

    Element at the given index.