[cxx-interop] Synthesize conformances to CxxRandomAccessCollection

This makes ClangImporter automatically conform C++ collection types to `Cxx.CxxRandomAccessCollection` protocol.

We consider a C++ sequence type to be a random access collection type its iterator conforms to `UnsafeCxxRandomAccessIterator`.
This commit is contained in:
Egor Zhdan
2022-10-28 18:16:28 +01:00
parent c7095e095b
commit 3cf84214b8
8 changed files with 70 additions and 21 deletions

View File

@@ -12,12 +12,6 @@
// CHECK: typealias RawIterator = ConstIteratorOutOfLineEq
// CHECK: }
// CHECK: struct SimpleArrayWrapper : CxxSequence {
// CHECK: typealias Element = UnsafePointer<Int32>.Pointee
// CHECK: typealias Iterator = CxxIterator<SimpleArrayWrapper>
// CHECK: typealias RawIterator = UnsafePointer<Int32>
// CHECK: }
// CHECK: struct SimpleArrayWrapperNullableIterators : CxxSequence {
// CHECK: typealias Element = Optional<UnsafePointer<Int32>>.Pointee
// CHECK: typealias Iterator = CxxIterator<SimpleArrayWrapperNullableIterators>