Sampling

public struct Sampling<Base: Collection, Selection: Collection>
where Selection.Element == Base.Index
extension Sampling : SamplingProtocol
extension Sampling: Collection
extension Sampling: BidirectionalCollection
where Selection: BidirectionalCollection
extension Sampling: RandomAccessCollection
where Selection: BidirectionalCollection

A lazy selection of elements, in a given order, from some base collection.

  • Creates an instance from base and selection.

    Declaration

    public init(base: Base, selection: Selection)
  • Declaration

    public typealias Element = Base.Element
  • A type whose instances represent positions in self.

    Declaration

    public typealias Index = Selection.Index
  • The position of the first element.

    Declaration

    public var startIndex: Index { get }
  • The position one past the last element.

    Declaration

    public var endIndex: Index { get }
  • Returns the element at i.

    Declaration

    public subscript(i: Index) -> Element { get }
  • Returns the position after i.

    Declaration

    public func index(after i: Index) -> Index