protocol
Indexable
Inheritance | View Protocol Hierarchy → |
---|---|
Associated Types |
|
Import |
|
Instance Variables
The collection's "past the end" position.
endIndex
is not a valid argument to subscript
, and is always
reachable from startIndex
by zero or more applications of
successor()
.
Complexity: O(1)
Declaration
var
endIndex
:
Self
.
Index
{
get
}
The position of the first element in a non-empty collection.
In an empty collection, startIndex == endIndex
.
Complexity: O(1)
Declaration
var
startIndex
:
Self
.
Index
{
get
}
Subscripts
Declaration
subscript
(
position
:
Self
.
Index
) -
>
Self
.
_Element
{
get
}
A type that represents a valid position in the collection.
Valid indices consist of the position of every element and a "past the end" position that's not valid for use as a subscript.