File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 2121
2222#include < cstring>
2323#include < memory>
24- #include < new>
2524#include < type_traits>
2625
2726#include " arrow/util/aligned_storage.h"
@@ -69,8 +68,7 @@ template <typename T>
6968inline std::enable_if_t <std::is_trivially_copyable_v<T>, T> SafeLoad (const T* unaligned) {
7069 using Type = std::remove_const_t <T>;
7170 arrow::internal::AlignedStorage<Type> raw_data;
72- std::memcpy (raw_data.get (), std::launder (reinterpret_cast <const uint8_t *>(unaligned)),
73- sizeof (T));
71+ std::memcpy (raw_data.get (), static_cast <const void *>(unaligned), sizeof (T));
7472 auto data = *raw_data.get ();
7573 raw_data.destroy ();
7674 return data;
@@ -83,8 +81,7 @@ inline std::enable_if_t<std::is_trivially_copyable_v<T> &&
8381SafeCopy (T value) {
8482 using TypeU = std::remove_const_t <U>;
8583 arrow::internal::AlignedStorage<TypeU> raw_data;
86- std::memcpy (raw_data.get (), std::launder (reinterpret_cast <const uint8_t *>(&value)),
87- sizeof (T));
84+ std::memcpy (raw_data.get (), static_cast <const void *>(&value), sizeof (T));
8885 auto data = *raw_data.get ();
8986 raw_data.destroy ();
9087 return data;
You can’t perform that action at this time.
0 commit comments