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

For C++20 use keyword requires instead of SFINAE magic #123

Merged
merged 6 commits into from
Oct 28, 2024

Conversation

g-217
Copy link
Contributor

@g-217 g-217 commented Aug 21, 2024

My earlier attempt to fix build failures on MSVS 17.6 and C++20 caused build failures on Ubuntu + clang-11.
I have created a PR to revert those changes, #122

Instead of changing existing working code, I am proposing to use C++20 keyword requires to check if << operator exists. With C++20 we can write a simpler check as following:

    if constexpr (requires { s << x; }) {
        s << x;
    }

@g-217 g-217 changed the title For C++20 use keyword require instead of SFINAE magic For C++20 use keyword requires instead of SFINAE magic Sep 18, 2024
Copy link
Member

@sean-parent sean-parent 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 good, but could you also add C++20 test builds to .github/workflows/adobe_source_libraries.yml?

@sean-parent sean-parent merged commit fcd6fb1 into stlab:main Oct 28, 2024
7 checks passed
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