Skip to content
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

[cxx-interop] Consider mapping C++ nullopt_t ctors to ExpressibleByNilLiteral conformance #72796

Open
egorzhdan opened this issue Apr 3, 2024 · 0 comments
Assignees
Labels
c++ interop Feature: Interoperability with C++ compiler The Swift compiler in itself feature A feature request or implementation

Comments

@egorzhdan
Copy link
Collaborator

Motivation

C++ codebases often define types that can store null as their state. Such types can commonly be initialized from nullptr.

Proposed solution

ClangImporter could map the nullopt C++ constructor to Swift's init(nilLiteral: ()) and automatically conform the type to ExpressibleByNilLiteral.

Alternatives considered

No response

Additional information

No response

@egorzhdan egorzhdan added c++ interop Feature: Interoperability with C++ compiler The Swift compiler in itself feature A feature request or implementation labels Apr 3, 2024
@egorzhdan egorzhdan self-assigned this Apr 3, 2024
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++ compiler The Swift compiler in itself feature A feature request or implementation
Projects
None yet
Development

No branches or pull requests

1 participant