From 00f700b7f024de6addf19621ca5e1b81a084c90a Mon Sep 17 00:00:00 2001 From: Rory Shu Date: Thu, 27 Jun 2024 04:20:49 -0700 Subject: [PATCH] test fix --- libredex/StlUtil.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libredex/StlUtil.h b/libredex/StlUtil.h index cc809c94679..1c32c6558f7 100644 --- a/libredex/StlUtil.h +++ b/libredex/StlUtil.h @@ -8,6 +8,7 @@ #pragma once #include +#include #include #include @@ -45,9 +46,11 @@ size_t erase_if(Container& c, const Pred& pred) { return removed; } -template -constexpr To bit_cast(const From& from) noexcept { - return __builtin_bit_cast(To, from); +template +constexpr To bit_cast(const From& src) noexcept { + To dst; + std::memcpy(&dst, &src, sizeof(To)); + return dst; } } // namespace std20