MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / bit_cast

Function bit_cast

src/ImathTest/testFun.cpp:25–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23#if !defined(__cpp_lib_bit_cast) || __cpp_lib_bit_cast < 201806L
24template <typename To, typename From>
25static inline To
26bit_cast (From from)
27{
28 static_assert (sizeof (From) == sizeof (To), "Type sizes do not match");
29 union
30 {
31 From f;
32 To t;
33 } u;
34 u.f = from;
35 return u.t;
36}
37#endif
38
39void

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected