Skip to content

Commit 00f700b

Browse files
committed
test fix
1 parent 1790677 commit 00f700b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

libredex/StlUtil.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#pragma once
99

1010
#include <algorithm>
11+
#include <cstring>
1112
#include <deque>
1213
#include <vector>
1314

@@ -45,9 +46,11 @@ size_t erase_if(Container& c, const Pred& pred) {
4546
return removed;
4647
}
4748

48-
template <typename To, typename From>
49-
constexpr To bit_cast(const From& from) noexcept {
50-
return __builtin_bit_cast(To, from);
49+
template <class To, class From>
50+
constexpr To bit_cast(const From& src) noexcept {
51+
To dst;
52+
std::memcpy(&dst, &src, sizeof(To));
53+
return dst;
5154
}
5255

5356
} // namespace std20

0 commit comments

Comments
 (0)