Skip to content

[cxx-interop] Change the hierarchy of CxxSequence protocols #63469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions stdlib/public/Cxx/CxxRandomAccessCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ public protocol CxxRandomAccessCollection<Element>: CxxSequence, RandomAccessCol
override associatedtype Index = Int
override associatedtype Indices = Range<Int>
override associatedtype SubSequence = Slice<Self>

/// Do not implement this function manually in Swift.
func __beginUnsafe() -> RawIterator

/// Do not implement this function manually in Swift.
func __endUnsafe() -> RawIterator
}

extension CxxRandomAccessCollection {
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/Cxx/CxxSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ extension Optional: UnsafeCxxInputIterator where Wrapped: UnsafeCxxInputIterator
/// 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`.
public protocol CxxSequence<Element>: Sequence {
public protocol CxxSequence<Element>: CxxConvertibleToCollection, Sequence {
override associatedtype Element
associatedtype RawIterator: UnsafeCxxInputIterator
override associatedtype RawIterator: UnsafeCxxInputIterator
where RawIterator.Pointee == Element
override associatedtype Iterator = CxxIterator<Self>

Expand Down