diff --git a/pvDataApp/misc/typeCast.h b/pvDataApp/misc/typeCast.h index 8bf33be..0717d0c 100644 --- a/pvDataApp/misc/typeCast.h +++ b/pvDataApp/misc/typeCast.h @@ -159,6 +159,14 @@ static FORCE_INLINE TO castUnsafe(const FROM& from) void castUnsafeV(size_t count, ScalarType to, void *dest, ScalarType from, const void *src); +//! Cast value to printable type +//! A no-op except for char types, which are cast to int +//! so that they are printed as numbers std::ostream operators. +template +static FORCE_INLINE +typename detail::print_cast::type +print_cast(const T& v) { return v; } + }} // end namespace #endif // PVTYPECAST_H