From d65abb28ea8fe10f49df5389ea2cc9081954c778 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 17 Apr 2020 13:39:00 -0700 Subject: [PATCH] shared_array fix print of char[] --- src/sharedarray.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sharedarray.cpp b/src/sharedarray.cpp index 7bc693b..7837a21 100644 --- a/src/sharedarray.cpp +++ b/src/sharedarray.cpp @@ -65,6 +65,14 @@ size_t elementSize(ArrayType type) namespace detail { namespace { + +template +struct Print { static inline const E& as(const E& val) { return val; } }; +template<> +struct Print { static inline int as(int8_t val) { return val; } }; +template<> +struct Print { static inline unsigned as(uint8_t val) { return val; } }; + template void showArr(std::ostream& strm, const void* raw, size_t count, size_t limit) { @@ -81,7 +89,7 @@ void showArr(std::ostream& strm, const void* raw, size_t count, size_t limit) strm<<"..."; break; } - strm<::as(base[i]); } strm<<']'; }