ProtocolCxx5.9.0
CxxRandomAccessCollection
protocol CxxRandomAccessCollection<Element> : CxxSequence, RandomAccessCollection where Self.RawIterator : UnsafeCxxRandomAccessIterator
Supertypes
protocol BidirectionalCollection
A collection that supports backward as well as forward traversal.
protocol Collection
A sequence whose elements can be traversed multiple times, nondestructively, and accessed by an indexed subscript.
protocol CxxConvertibleToCollection
A C++ type that can be converted to a Swift collection.
protocol CxxSequence
Use this protocol to conform custom C++ sequence types to Swift’s
Sequence
protocol like this:protocol RandomAccessCollection
A collection that supports efficient random-access index traversal.
protocol Sequence
A type that provides sequential, iterated access to its elements.
Requirements
Citizens in Cxx
Members
var count: Int
var endIndex: Int
var startIndex: Int
subscript(Int
) -> Self.Element A C++ implementation of the subscript might be more performant. This overload should only be used if the C++ type does not define
operator[]
.