MCPcopy Create free account
hub / github.com/AllentDan/LibtorchTutorials / reinterpret_bits

Function reinterpret_bits

lesson6-Segmentation/json.hpp:14380–14387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14378
14379template<typename Target, typename Source>
14380Target reinterpret_bits(const Source source)
14381{
14382 static_assert(sizeof(Target) == sizeof(Source), "size mismatch");
14383
14384 Target target;
14385 std::memcpy(&target, &source, sizeof(Source));
14386 return target;
14387}
14388
14389struct diyfp // f * 2^e
14390{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected