what’s new in C++ interoperability?
Generated on 7/31/2024
1 search
In the "What's new in Swift" session at WWDC 2024, several updates were introduced regarding C++ interoperability. Here are the key points:
- C++ Virtual Methods and Default Arguments: These are now mapped to their equivalent Swift versions, making it easier to work with C++ code in Swift.
- C++ Move-Only Types: Types like the C++
std::unique_ptr
are mapped to non-copyable types in Swift. The Swift compiler will insert calls to the C++ move constructor when needed and will diagnose if you unintentionally try to copy a non-copyable value. - Incremental Adoption: You can incrementally adopt Swift in your C++ projects, improving security and productivity. This is particularly useful for large codebases.
For more detailed information, you can watch the segment on C++ interoperability in the "What's new in Swift" session here.
Relevant Sessions
What’s new in Swift
Join us for an update on Swift. We’ll briefly go through a history of Swift over the past decade, and show you how the community has grown through workgroups, expanded the package ecosystem, and increased platform support. We’ll introduce you to a new language mode that achieves data-race safety by default, and a language subset that lets you run Swift on highly constrained systems. We’ll also explore some language updates including noncopyable types, typed throws, and improved C++ interoperability.
Platforms State of the Union 5-Minute Recap
Watch a quick recap of the newest advancements on Apple platforms.
Platforms State of the Union
Discover the newest advancements on Apple platforms.