0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-11-24 15:19:31 -05:00

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
This commit is contained in:
CGQAQ 2023-09-07 10:42:42 +08:00
parent 4cf545b925
commit d1b32dab8e

View file

@ -77,7 +77,8 @@ struct make_pod {
// Using a union is a C++ trick to achieve this.
template <class V>
union helper {
static_assert(std::is_pod<P>::value, "type P must a pod type");
static_assert(std::is_trivially_copyable<V>::value, "type V must be trivially copyable");
static_assert(std::is_standard_layout<P>::value && std::is_trivially_copyable<P>::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");