1 #ifndef dune_artdaq_Overlays_Utilities_hh 2 #define dune_artdaq_Overlays_Utilities_hh 4 #include "cetlib_except/exception.h" 27 template <
typename S,
typename T>
30 S outptr =
reinterpret_cast<S>( inptr );
32 const void* inptr_void =
static_cast<const void*
>( inptr );
33 const void* outptr_void =
static_cast<const void*
>( outptr );
35 if ( inptr_void != outptr_void ) {
36 throw cet::exception(
"reinterpret_cast_checked") <<
"Error: reinterpret_cast casted " << inptr_void <<
" to " << outptr_void <<
" => results of the cast can't be trusted";
void display_bits(void *memstart, size_t nbytes, std::string sourcename)
S reinterpret_cast_checked(T inptr)
cet::coded_exception< error, detail::translate > exception