31template <
typename TDestination,
class TSource>
35 static_assert(
sizeof(TDestination) ==
sizeof(TSource),
36 "The destination type should have the same size as the source type.");
37 static_assert(std::is_trivially_copyable_v<TDestination>,
"The destination type should be trivially copyable");
38 static_assert(std::is_trivially_copyable_v<TSource>,
"The source type should be trivially copyable.");
41 std::remove_const_t<TDestination> result;
42 std::memcpy(&result, &source,
sizeof(TSource));
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
TDestination bit_cast(const TSource &source)