Skip to content

Commit cfad960

Browse files
authored
Merge pull request #63469 from apple/egorzhdan/cxx-convertible-rehierarchy
[cxx-interop] Change the hierarchy of CxxSequence protocols
2 parents f1051f1 + 7ec8054 commit cfad960

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

stdlib/public/Cxx/CxxRandomAccessCollection.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ public protocol CxxRandomAccessCollection<Element>: CxxSequence, RandomAccessCol
3636
override associatedtype Index = Int
3737
override associatedtype Indices = Range<Int>
3838
override associatedtype SubSequence = Slice<Self>
39-
40-
/// Do not implement this function manually in Swift.
41-
func __beginUnsafe() -> RawIterator
42-
43-
/// Do not implement this function manually in Swift.
44-
func __endUnsafe() -> RawIterator
4539
}
4640

4741
extension CxxRandomAccessCollection {

stdlib/public/Cxx/CxxSequence.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ extension Optional: UnsafeCxxInputIterator where Wrapped: UnsafeCxxInputIterator
6565
/// This requires the C++ sequence type to define const methods `begin()` and
6666
/// `end()` which return input iterators into the C++ sequence. The iterator
6767
/// types must conform to `UnsafeCxxInputIterator`.
68-
public protocol CxxSequence<Element>: Sequence {
68+
public protocol CxxSequence<Element>: CxxConvertibleToCollection, Sequence {
6969
override associatedtype Element
70-
associatedtype RawIterator: UnsafeCxxInputIterator
70+
override associatedtype RawIterator: UnsafeCxxInputIterator
7171
where RawIterator.Pointee == Element
7272
override associatedtype Iterator = CxxIterator<Self>
7373

0 commit comments

Comments
 (0)