From 69c6e9e5af73cb19ecbed89d0014ae5b26bed361 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 2 Nov 2024 22:32:23 +0100 Subject: [PATCH] tools/ceph-dencoder/sstring.h: use `char8_t` instead of `unsigned char` This fixes a build failure with libc++ (clang/LLVM). This build failure is correct: there exists no specialization for `std::char_traits`. The standards-compliant way to use unsigned chars in strings is to use `char8_t`. Signed-off-by: Max Kellermann --- src/common/sstring.hh | 1 + src/tools/ceph-dencoder/sstring.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/sstring.hh b/src/common/sstring.hh index b0fcd9b5c47..7e0d6c6b1e2 100644 --- a/src/common/sstring.hh +++ b/src/common/sstring.hh @@ -44,6 +44,7 @@ template class basic_sstring { static_assert( (std::is_same::value + || std::is_same::value || std::is_same::value || std::is_same::value), "basic_sstring only supports single byte char types"); diff --git a/src/tools/ceph-dencoder/sstring.h b/src/tools/ceph-dencoder/sstring.h index c2493c10efa..829a0eb307f 100644 --- a/src/tools/ceph-dencoder/sstring.h +++ b/src/tools/ceph-dencoder/sstring.h @@ -7,7 +7,7 @@ class sstring_wrapper { using sstring16 = basic_sstring; sstring16 s1; - using sstring24 = basic_sstring; + using sstring24 = basic_sstring; sstring24 s2; public: sstring_wrapper() = default; -- 2.39.5