We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1790677 commit 00f700bCopy full SHA for 00f700b
libredex/StlUtil.h
@@ -8,6 +8,7 @@
8
#pragma once
9
10
#include <algorithm>
11
+#include <cstring>
12
#include <deque>
13
#include <vector>
14
@@ -45,9 +46,11 @@ size_t erase_if(Container& c, const Pred& pred) {
45
46
return removed;
47
}
48
-template <typename To, typename From>
49
-constexpr To bit_cast(const From& from) noexcept {
50
- return __builtin_bit_cast(To, from);
+template <class To, class From>
+constexpr To bit_cast(const From& src) noexcept {
51
+ To dst;
52
+ std::memcpy(&dst, &src, sizeof(To));
53
+ return dst;
54
55
56
} // namespace std20
0 commit comments