From: Max Kellermann Date: Sat, 2 Nov 2024 21:32:23 +0000 (+0100) Subject: tools/ceph-dencoder/sstring.h: use `char8_t` instead of `unsigned char` X-Git-Tag: v20.0.0~567^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F60997%2Fhead;p=ceph.git 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 --- 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;