|
| 1 | +From 354ddfecd33067d8aac339437defdcf0b8c32b68 Mon Sep 17 00:00:00 2001 |
| 2 | +From: =?UTF-8?q?Tommi=20M=C3=A4kitalo?= <tommi@tntnet.org> |
| 3 | +Date: Tue, 25 Apr 2023 13:44:17 +0200 |
| 4 | +Subject: [PATCH] Fix for C++20 |
| 5 | + |
| 6 | +some typedefs are removed from std::allocator |
| 7 | +--- |
| 8 | + include/cxxtools/string.h | 8 ++++---- |
| 9 | + src/charmapcodec.cpp | 2 +- |
| 10 | + 2 files changed, 5 insertions(+), 5 deletions(-) |
| 11 | + |
| 12 | +diff --git a/include/cxxtools/string.h b/include/cxxtools/string.h |
| 13 | +index e8ea4f25..020bb043 100644 |
| 14 | +--- a/include/cxxtools/string.h |
| 15 | ++++ b/include/cxxtools/string.h |
| 16 | +@@ -51,10 +51,10 @@ class basic_string< cxxtools::Char > { |
| 17 | + typedef char_traits< cxxtools::Char > traits_type; |
| 18 | + typedef std::allocator<cxxtools::Char> allocator_type; |
| 19 | + typedef allocator_type::difference_type difference_type; |
| 20 | +- typedef allocator_type::reference reference; |
| 21 | +- typedef allocator_type::const_reference const_reference; |
| 22 | +- typedef allocator_type::pointer pointer; |
| 23 | +- typedef allocator_type::const_pointer const_pointer; |
| 24 | ++ typedef value_type& reference; |
| 25 | ++ typedef const value_type& const_reference; |
| 26 | ++ typedef value_type* pointer; |
| 27 | ++ typedef const value_type* const_pointer; |
| 28 | + typedef value_type* iterator; |
| 29 | + typedef const value_type* const_iterator; |
| 30 | + |
| 31 | +diff --git a/src/charmapcodec.cpp b/src/charmapcodec.cpp |
| 32 | +index 5eb08136..2e01b2a9 100644 |
| 33 | +--- a/src/charmapcodec.cpp |
| 34 | ++++ b/src/charmapcodec.cpp |
| 35 | +@@ -82,7 +82,7 @@ CharMapCodec::result CharMapCodec::do_out(MBState& /*s*/, const Char* fromBegin, |
| 36 | + while (fromNext < fromEnd && toNext < toEnd) |
| 37 | + { |
| 38 | + *toNext = toChar(_charMap, *fromNext); |
| 39 | +- log_debug(fromNext->value() << " => " << static_cast<unsigned>(static_cast<unsigned char>(*toNext))); |
| 40 | ++ log_debug(static_cast<unsigned>(fromNext->value()) << " => " << static_cast<unsigned>(static_cast<unsigned char>(*toNext))); |
| 41 | + ++fromNext; |
| 42 | + ++toNext; |
| 43 | + } |
0 commit comments