MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / bit_cast

Function bit_cast

src/include/base64.hpp:26–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#else
25template <class To, class From>
26std::enable_if_t<sizeof(To) == sizeof(From) &&
27 std::is_trivially_copyable_v<From> &&
28 std::is_trivially_copyable_v<To>,
29 To>
30bit_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
41inline constexpr char padding_char{'='};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected