Type Aliasswift 6.0.3Swift
Index
A type that represents a valid position in the collection.
typealias Index = Int
Valid indices consist of the position of every element and a “past the end” position that’s not valid for use as a subscript.
A type that represents a valid position in the collection.
typealias Index = Int
Valid indices consist of the position of every element and a “past the end” position that’s not valid for use as a subscript.
import Swift
@frozen struct EmptyCollection<Element>
A collection whose element type is Element
but that is always empty.
@frozen struct Int
A signed integer value type.
init()
Creates an instance.
var count: Int { get }
The number of elements (always zero).
var endIndex: EmptyCollection<Element>.Index { get }
Always zero, just like startIndex
.
var startIndex: EmptyCollection<Element>.Index { get }
Always zero, just like endIndex
.
subscript(bounds: Range<EmptyCollection<Element>.Index>) -> EmptyCollection<Element>.SubSequence { get set }
subscript(position: EmptyCollection<Element>.Index) -> Element { get set }
Accesses the element at the given position.
static func == (lhs: EmptyCollection<Element>, rhs: EmptyCollection<Element>) -> Bool
func distance(from start: EmptyCollection<Element>.Index, to end: EmptyCollection<Element>.Index) -> Int
The distance between two indexes (always zero).
func index(_ i: EmptyCollection<Element>.Index, offsetBy n: Int) -> EmptyCollection<Element>.Index
func index(_ i: EmptyCollection<Element>.Index, offsetBy n: Int, limitedBy limit: EmptyCollection<Element>.Index) -> EmptyCollection<Element>.Index?
func index(after i: EmptyCollection<Element>.Index) -> EmptyCollection<Element>.Index
Always traps.
func index(before i: EmptyCollection<Element>.Index) -> EmptyCollection<Element>.Index
Always traps.
func makeIterator() -> EmptyCollection<Element>.Iterator
Returns an empty iterator.
@frozen struct Iterator
An iterator that never produces an element.
typealias Indices = Range<Int>
typealias SubSequence = EmptyCollection<Element>