Skip to content

Concurrency: centralise the definition for std::bit_cast #78985

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
Jan 29, 2025

Conversation

compnerd
Copy link
Member

Remove the multiple definitions of std::bit_cast into a header. While this is still not great, it does reduce the duplication. This also silently works towards reducing a bit of the UB introduced here by adding an inline namespace for std which you are not technically allowed to use. However, by doing this, we have a clear migration path away from this once we adopt C++20.

@compnerd
Copy link
Member Author

CC: @tshortli

@compnerd
Copy link
Member Author

@swift-ci please smoke test

Remove the multiple definitions of `std::bit_cast` into a header. While
this is still not great, it does reduce the duplication. This also
silently works towards reducing a bit of the UB introduced here by
adding an inline namespace for `std` which you are not technically
allowed to use. However, by doing this, we have a clear migration path
away from this once we adopt C++20.
Copy link
Contributor

@tshortli tshortli left a comment

Choose a reason for hiding this comment

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

Thanks!

@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd compnerd merged commit 0e73015 into swiftlang:main Jan 29, 2025
5 checks passed
@compnerd compnerd deleted the central-dispatch branch January 29, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants