Skip to content

Commit fab4169

Browse files
author
MarcoFalke
committed
Allow int8_t optimized vector serialization
int8_t serialization is allowed, but not the optimized vector serialization. Fix that.
1 parent facaa14 commit fab4169

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/span.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,11 @@ Span<std::byte> MakeWritableByteSpan(V&& v) noexcept
287287
// Helper functions to safely cast basic byte pointers to unsigned char pointers.
288288
inline unsigned char* UCharCast(char* c) { return reinterpret_cast<unsigned char*>(c); }
289289
inline unsigned char* UCharCast(unsigned char* c) { return c; }
290+
inline unsigned char* UCharCast(signed char* c) { return reinterpret_cast<unsigned char*>(c); }
290291
inline unsigned char* UCharCast(std::byte* c) { return reinterpret_cast<unsigned char*>(c); }
291292
inline const unsigned char* UCharCast(const char* c) { return reinterpret_cast<const unsigned char*>(c); }
292293
inline const unsigned char* UCharCast(const unsigned char* c) { return c; }
294+
inline const unsigned char* UCharCast(const signed char* c) { return reinterpret_cast<const unsigned char*>(c); }
293295
inline const unsigned char* UCharCast(const std::byte* c) { return reinterpret_cast<const unsigned char*>(c); }
294296
// Helper concept for the basic byte types.
295297
template <typename B>

0 commit comments

Comments
 (0)