diff --git a/libredex/StlUtil.h b/libredex/StlUtil.h index cc809c9467..1c32c6558f 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