Skip to content

Commit da02016

Browse files
authored
[cxx-interop] Specify Iterator explicitly for CxxRandomAccessCollection
This helps to avoid ambiguity errors when manually conforming a type to `CxxRandomAccessCollection` protocol.
1 parent 6a07e0e commit da02016

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/Cxx/CxxRandomAccessCollection.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extension UnsafeMutablePointer: UnsafeCxxRandomAccessIterator {}
3030

3131
public protocol CxxRandomAccessCollection: CxxSequence, RandomAccessCollection {
3232
override associatedtype RawIterator: UnsafeCxxRandomAccessIterator
33+
override associatedtype Iterator = CxxIterator<Self>
3334
override associatedtype Element = RawIterator.Pointee
3435
override associatedtype Index = Int
3536
override associatedtype Indices = Range<Int>

0 commit comments

Comments
 (0)