Instance Subscriptswift 6.0.3Swift
subscript(_:)
- iOS
- 18.0+
- macOS
- 15.0+
- tvOS
- 18.0+
- visionOS
- 2.0+
- watchOS
- 11.0+
subscript(i: DiscontiguousSlice<Base>.Index) -> Base.Element { get }
subscript(i: DiscontiguousSlice<Base>.Index) -> Base.Element { get }
where Base:Collection
import Swift
struct DiscontiguousSlice<Base> where Base : Collection
A collection wrapper that provides access to the elements of a collection, indexed by a set of indices.
struct Index
A position in a DiscontiguousSlice
.
associatedtype Element where Self.Element == Self.Iterator.Element
A type representing the sequence’s elements.
protocol Collection<Element> : Sequence
A sequence whose elements can be traversed multiple times, nondestructively, and accessed by an indexed subscript.
var count: Int { get }
var description: String { get }
var endIndex: DiscontiguousSlice<Base>.Index { get }
var isEmpty: Bool { get }
var startIndex: DiscontiguousSlice<Base>.Index { get }
subscript(bounds: Range<DiscontiguousSlice<Base>.Index>) -> DiscontiguousSlice<Base> { get }
func distance(from start: DiscontiguousSlice<Base>.Index, to end: DiscontiguousSlice<Base>.Index) -> Int
func index(after i: DiscontiguousSlice<Base>.Index) -> DiscontiguousSlice<Base>.Index
typealias Element = Base.Element
typealias Indices = DefaultIndices<DiscontiguousSlice<Base>>
typealias Iterator = IndexingIterator<DiscontiguousSlice<Base>>
typealias SubSequence = DiscontiguousSlice<Base>