Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is necessary to avoid compilation errors using recent libc++ versions with C++23 due to libc++ taking steps to remove transitive includes in newer C++ versions 0.
For a more concrete example, this program builds using Clang 16.0.0 and C++20, but fails to build with C++23:
The compiler hits the "too many errors" threshold when building with C++23, but I believe this is due to compiling failing to recover after the first error. The error message starts with:
std::equal_to is defined in
<functional>
, but<functional>
is not directly included by magic_enum.hpp.<string>
1 and<string_view>
2 both include<functional>
for C++20 and earlier, but they no longer include<functional>
in C++23 and later, so a definition forstd::equal_to
is no longer visible, leading to the above error.Directly including
<functional>
fixes this error, but I'm not sure there aren't similar errors.