From 9cbf4d99231bf495a23cb78be504bd9ffd29eadd Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 8 Oct 2023 20:24:25 -0700 Subject: Avoid std::aligned_storage, it's deprecated in newer C++ --- common/albit.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common/albit.h') diff --git a/common/albit.h b/common/albit.h index 962eb0aa..82a4a00d 100644 --- a/common/albit.h +++ b/common/albit.h @@ -17,9 +17,9 @@ std::enable_if_t, To> bit_cast(const From &src) noexcept { - std::aligned_storage_t dst; - std::memcpy(&dst, &src, sizeof(To)); - return *std::launder(reinterpret_cast(&dst)); + alignas(To) char dst[sizeof(To)]; + std::memcpy(&dst[0], &src, sizeof(To)); + return *std::launder(reinterpret_cast(&dst[0])); } #ifdef __BYTE_ORDER__ -- cgit v1.2.3