ProtocolCxx5.9.0
CxxSequence
Use this protocol to conform custom C++ sequence types to Swift’s Sequence
protocol like this:
protocol CxxSequence<Element> : CxxConvertibleToCollection, Sequence
extension MyCxxSequenceType : CxxSequence {}
This requires the C++ sequence type to define const methods begin()
and end()
which return input iterators into the C++ sequence. The iterator types must conform to UnsafeCxxInputIterator
.
Supertypes
protocol CxxConvertibleToCollection
A C++ type that can be converted to a Swift collection.
protocol Sequence
A type that provides sequential, iterated access to its elements.
Requirements
Citizens in Cxx
Members
func makeIterator(
) -> CxxIterator<Self> Returns an iterator over the elements of this C++ container.