-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
std::is_pod is deprecated in C++20 #1913
Comments
Thanks for reporting. template < typename C = CharType,
enable_if_t < std::is_signed<C>::value and std::is_unsigned<char>::value > * = nullptr >
static CharType to_char_type(std::uint8_t x) noexcept
{
static_assert(sizeof(std::uint8_t) == sizeof(CharType), "size of CharType must be equal to std::uint8_t");
static_assert(std::is_pod<CharType>::value, "CharType must be POD");
CharType result;
std::memcpy(&result, &x, sizeof(x));
return result;
} I think replacing this with |
To be able to do
Standard layout however adds a lot of constraints I guess for most of them it's a bit strange to be unsatisfied in hypothetical My conclusion is that |
I created a branch for this: https://github.com/nlohmann/json/tree/feature/issue1913 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have a branch for this an will finish this after my vacation. |
Newest msvc preview version already implements warning for this case. While it's not urgent in any way, it might be nice to replace it with either
std::is_standard_layout
orstd::is_trivial
to avoid warnings during compilation with newer standard support.Here you can find more details on its deprecation:
https://stackoverflow.com/questions/48225673/why-is-stdis-pod-deprecated-in-c20
The text was updated successfully, but these errors were encountered: