From d1b32dab8e65ba2d960266d915dd40238cef7129 Mon Sep 17 00:00:00 2001 From: CGQAQ Date: Thu, 7 Sep 2023 10:42:42 +0800 Subject: [PATCH] fix: fix make_pod static asserts * std::is_pod is deprecated in c++20 changed to std::is_standard_layout && is_trivial * V shoud be trivially_copyable in order to copy from --- src/support.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/support.h b/src/support.h index 2d7d6de9..388b223b 100644 --- a/src/support.h +++ b/src/support.h @@ -77,7 +77,8 @@ struct make_pod { // Using a union is a C++ trick to achieve this. template union helper { - static_assert(std::is_pod

::value, "type P must a pod type"); + static_assert(std::is_trivially_copyable::value, "type V must be trivially copyable"); + static_assert(std::is_standard_layout

::value && std::is_trivially_copyable

::value, "type P must a pod type"); static_assert(sizeof(V) == sizeof(P), "type P must be same size as type V"); static_assert(alignof(V) == alignof(P), "alignment of type P must be compatible with that of type V");