aboutsummaryrefslogtreecommitdiff
path: root/src/span.h
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-12-19 14:20:47 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-12-22 09:58:19 +0100
commitfab41697a5448ef2861f65795bd63a4ccdda6a40 (patch)
tree614442394443fa0a1dd5013b7af2b6768837de13 /src/span.h
parentfacaa14785e006c1af5a8b17b10e2722af8d054e (diff)
Allow int8_t optimized vector serialization
int8_t serialization is allowed, but not the optimized vector serialization. Fix that.
Diffstat (limited to 'src/span.h')
-rw-r--r--src/span.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/span.h b/src/span.h
index 2c27a54fc7..c974c265ce 100644
--- a/src/span.h
+++ b/src/span.h
@@ -287,9 +287,11 @@ Span<std::byte> MakeWritableByteSpan(V&& v) noexcept
// Helper functions to safely cast basic byte pointers to unsigned char pointers.
inline unsigned char* UCharCast(char* c) { return reinterpret_cast<unsigned char*>(c); }
inline unsigned char* UCharCast(unsigned char* c) { return c; }
+inline unsigned char* UCharCast(signed char* c) { return reinterpret_cast<unsigned char*>(c); }
inline unsigned char* UCharCast(std::byte* c) { return reinterpret_cast<unsigned char*>(c); }
inline const unsigned char* UCharCast(const char* c) { return reinterpret_cast<const unsigned char*>(c); }
inline const unsigned char* UCharCast(const unsigned char* c) { return c; }
+inline const unsigned char* UCharCast(const signed char* c) { return reinterpret_cast<const unsigned char*>(c); }
inline const unsigned char* UCharCast(const std::byte* c) { return reinterpret_cast<const unsigned char*>(c); }
// Helper concept for the basic byte types.
template <typename B>