Protocolswift 6.0.3Cxx
CxxRandomAccessCollection
protocol CxxRandomAccessCollection<Element> : CxxSequence, RandomAccessCollection where Self.RawIterator : UnsafeCxxRandomAccessIterator
Browse conforming typesprotocol CxxRandomAccessCollection<Element> : CxxSequence, RandomAccessCollection where Self.RawIterator : UnsafeCxxRandomAccessIterator
import Cxx
associatedtype Element
protocol CxxSequence<Element> : CxxConvertibleToCollection, Sequence
Use this protocol to conform custom C++ sequence types to Swift’s Sequence
protocol like this:
protocol RandomAccessCollection<Element> : BidirectionalCollection where Self.Indices : RandomAccessCollection, Self.SubSequence : RandomAccessCollection
A collection that supports efficient random-access index traversal.
associatedtype RawIterator : UnsafeCxxInputIterator
protocol UnsafeCxxRandomAccessIterator : UnsafeCxxInputIterator
Bridged C++ iterator that allows computing the distance between two of its instances, and advancing an instance by a given number of elements.
protocol BidirectionalCollection<Element> : Collection where Self.Indices : BidirectionalCollection, Self.SubSequence : BidirectionalCollection
A collection that supports backward as well as forward traversal.
protocol Collection<Element> : Sequence
A sequence whose elements can be traversed multiple times, nondestructively, and accessed by an indexed subscript.
protocol CxxConvertibleToCollection<Element>
A C++ type that can be converted to a Swift collection.
protocol Sequence<Element>
A type that provides sequential, iterated access to its elements.
associatedtype Index = Int
associatedtype Indices = Range<Int>
associatedtype Iterator = CxxIterator<Self>
associatedtype RawIterator
associatedtype SubSequence = Slice<Self>
var count: Int { get }
var endIndex: Int { get }
var startIndex: Int { get }
subscript(index: Int) -> Self.Element { get }
A C++ implementation of the subscript might be more performant. This overload should only be used if the C++ type does not define operator[]
.