blob: c2304bdd48ba771b098912e38797dc4b114f7470 [file] [log] [blame]
Andrew Geisslerc5535c92023-01-27 16:10:19 -06001From 93987b1ce7d6f91387202495aac61026070597df Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 15 Jan 2023 21:37:52 -0800
4Subject: [PATCH] Deprecate u8string_view
5
6Use basic_string_view instead
7
8Upstream-Status: Backport [https://github.com/fmtlib/fmt/commit/dea7fde8b7d649923dd41b0766bdf076033c62a2]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 include/spdlog/fmt/bundled/core.h | 3 ++-
12 include/spdlog/fmt/bundled/format.h | 15 ++-------------
13 2 files changed, 4 insertions(+), 14 deletions(-)
14
15diff --git a/include/spdlog/fmt/bundled/core.h b/include/spdlog/fmt/bundled/core.h
16index 50b79351..e8b029ef 100644
17--- a/include/spdlog/fmt/bundled/core.h
18+++ b/include/spdlog/fmt/bundled/core.h
19@@ -1484,7 +1484,8 @@ FMT_API void vprint(wstring_view format_str, wformat_args args);
20
21 /**
22 \rst
23- Prints formatted data to ``stdout``.
24+ Formats ``args`` according to specifications in ``format_str`` and writes the
25+ output to ``stdout``.
26
27 **Example**::
28
29diff --git a/include/spdlog/fmt/bundled/format.h b/include/spdlog/fmt/bundled/format.h
30index 1bb24a52..39426361 100644
31--- a/include/spdlog/fmt/bundled/format.h
32+++ b/include/spdlog/fmt/bundled/format.h
33@@ -407,21 +407,10 @@ void basic_buffer<T>::append(const U *begin, const U *end) {
34 enum char8_t: unsigned char {};
35 #endif
36
37-// A UTF-8 string view.
38-class u8string_view : public basic_string_view<char8_t> {
39- public:
40- typedef char8_t char_type;
41-
42- u8string_view(const char *s):
43- basic_string_view<char8_t>(reinterpret_cast<const char8_t*>(s)) {}
44- u8string_view(const char *s, size_t count) FMT_NOEXCEPT:
45- basic_string_view<char8_t>(reinterpret_cast<const char8_t*>(s), count) {}
46-};
47-
48 #if FMT_USE_USER_DEFINED_LITERALS
49 inline namespace literals {
50-inline u8string_view operator"" _u(const char *s, std::size_t n) {
51- return {s, n};
52+inline basic_string_view<char8_t> operator"" _u(const char* s, std::size_t n) {
53+ return {reinterpret_cast<const char8_t*>(s), n};
54 }
55 }
56 #endif
57--
582.39.0
59