Skip to content

[cxx-interop] Conform std::string to ExpressibleByStringInterpolation #80090

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
Mar 19, 2025

Conversation

egorzhdan
Copy link
Contributor

This adds conformances for C++ string types (std::string, std::u16string, std::u32string) to Swift.ExpressibleByStringInterpolation.

These conformances currently implicitly use DefaultStringInterpolation. In the future we can provide more performant interpolation mechanisms for C++ strings specifically that avoid the extra conversion between Swift String and C++ string types.

rdar://147249169

…ion`

This adds conformances for C++ string types (`std::string`, `std::u16string`, `std::u32string`) to `Swift.ExpressibleByStringInterpolation`.

These conformances currently implicitly use `DefaultStringInterpolation`. In the future we can provide more performant interpolation mechanisms for C++ strings specifically that avoid the extra conversion between Swift String and C++ string types.

rdar://147249169
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Mar 18, 2025
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@egorzhdan
Copy link
Contributor Author

@swift-ci please build toolchain Ubuntu 22.04

@egorzhdan
Copy link
Contributor Author

@swift-ci please test Windows

@egorzhdan egorzhdan merged commit 02dfe26 into main Mar 19, 2025
6 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/std-string-interpolation branch March 19, 2025 18:28
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