RandomAccessCollectionWrapping
public protocol RandomAccessCollectionWrapping : RandomAccessCollection
Interface for wrapping any RandomAccessCollection
type. The RandomAccessCollection
interface
is exposed, regardless of the concrete implementation of the wrapped type.
The performance guarantees made by the RandomAccessCollection
are sustained.
-
Wrapped
RandomAccessCollection
-conforming type.Declaration
Swift
associatedtype Base : RandomAccessCollection
-
Wrapped
RandomAccessCollection
-conforming type.Declaration
Swift
var base: Base { get }
-
startIndex
Extension methodStart index.
Complexity
O(1)Declaration
Swift
public var startIndex: Base.Index { get }
-
endIndex
Extension methodEnd index.
Complexity
O(1)Declaration
Swift
public var endIndex: Base.Index { get }
-
first
Extension methodFirst element, if there is at least one element. Otherwise,
nil
.Complexity
O(1)Declaration
Swift
public var first: Base.Element? { get }
-
last
Extension methodLast element, if there is at least one element. Otherwise,
nil
.Complexity
O(1)Declaration
Swift
public var last: Base.Element? { get }
-
count
Extension methodAmount of elements.
Complexity
O(1)Declaration
Swift
public var count: Int { get }
-
isEmpty
Extension methodComplexity
O(1)
Declaration
Swift
public var isEmpty: Bool { get }
Return Value
true
if there are no elements contained herein. Otherwise,false
. -
subscript(_:
Extension method) -
index(after:
Extension method) -
index(before:
Extension method)