| 24 | #else |
| 25 | template <class To, class From> |
| 26 | std::enable_if_t<sizeof(To) == sizeof(From) && |
| 27 | std::is_trivially_copyable_v<From> && |
| 28 | std::is_trivially_copyable_v<To>, |
| 29 | To> |
| 30 | bit_cast(const From& src) noexcept { |
| 31 | static_assert(std::is_trivially_constructible_v<To>, |
| 32 | "This implementation additionally requires " |
| 33 | "destination type to be trivially constructible"); |
| 34 | |
| 35 | To dst; |
| 36 | std::memcpy(&dst, &src, sizeof(To)); |
| 37 | return dst; |
| 38 | } |
| 39 | #endif |
| 40 | |
| 41 | inline constexpr char padding_char{'='}; |
nothing calls this directly
no outgoing calls
no test coverage detected