Skip to content

[cxx-interop] Synthesize conformances to CxxSequence #60332

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
Aug 17, 2022

Conversation

egorzhdan
Copy link
Contributor

This makes ClangImporter automatically conform C++ sequence types to Cxx.CxxSequence protocol.

We consider a C++ type to be a sequence type if it defines begin() & end() methods that return iterators of the same type which conforms to UnsafeCxxInputIterator.

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Aug 1, 2022
@egorzhdan egorzhdan requested review from hyp, Huddie and zoecarver August 1, 2022 12:03
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@zoecarver zoecarver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks perfect, as usual :)

@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-synthesize-sequence branch 2 times, most recently from eac5418 to e29288d Compare August 4, 2022 10:11
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-synthesize-sequence branch from e29288d to 01797c5 Compare August 12, 2022 11:32
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

This makes ClangImporter automatically conform C++ sequence types to `Cxx.CxxSequence` protocol.

We consider a C++ type to be a sequence type if it defines `begin()` & `end()` methods that return iterators of the same type which conforms to `UnsafeCxxInputIterator`.
@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-synthesize-sequence branch from 09b8d73 to e3a3217 Compare August 17, 2022 15:07
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan merged commit fb1859d into main Aug 17, 2022
@egorzhdan egorzhdan deleted the egorzhdan/cxx-synthesize-sequence branch August 17, 2022 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants