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

cmake: Enable C++20 standard globally #1868

Closed
wants to merge 1 commit into from
Closed

Conversation

Wunkolo
Copy link
Contributor

@Wunkolo Wunkolo commented Mar 9, 2025

Globally enables C++20 rather than just for individual projects. This enables C++20 features across the whole code base rather just C++17 as a baseline.

std::result_of was removed from the standard library as of C++20 and has been replaced with std::invoke_result.

https://en.cppreference.com/w/cpp/types/result_of

Globally enables C++20 rather than just for individual projects.  This
enables C++20 features across the whole code base rather just C++17 as a
baseline.

`std::result_of` was removed from the standard library as of C++20 and
has been replaced with `std::invoke_result`.
@Wunkolo
Copy link
Contributor Author

Wunkolo commented Mar 9, 2025

This seems to be an interaction between UWP, SDL, and C++20:

cl : command line  error D8016: '/ZW' and '/std:c++20' command-line options are incompatible

Looks like there was a related fix upstream here in SDL3:
libsdl-org/SDL#9550
libsdl-org/SDL#9649

@Wunkolo
Copy link
Contributor Author

Wunkolo commented Mar 14, 2025

UWP builds use WinRT at the moment, so any C++20 features that touch these UWP related files will cause this error. Seems to be the only thing holding back this feature 😖. Not sure if UWP can be migrated to off of WinRT.

@flyinghead
Copy link
Owner

We should probably stay with c++ 17 for now then. I was experimenting with std::filesystem and the new std::u8string of c++20 is a pain to work with.

@Wunkolo Wunkolo closed this Mar 25, 2025
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