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: RandomAccessCollection
A lazy selection of elements, in a given order, from some base collection.
-
Creates an instance from
base
andselection
.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 }