File: 0007-Fix-deprecated-declarations-in-C-17.patch

package info (click to toggle)
opencc 1.1.9%2Bds1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,324 kB
  • sloc: cpp: 4,682; python: 350; javascript: 133; makefile: 125; sh: 59
file content (33 lines) | stat: -rw-r--r-- 825 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From: WhiredPlanck <whiredplanck@outlook.com>
Date: Sat, 5 Jul 2025 03:57:30 +0800
Subject: Fix deprecated declarations in C++17

---
 src/Segments.hpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/Segments.hpp b/src/Segments.hpp
index 2186dfd..57320fe 100644
--- a/src/Segments.hpp
+++ b/src/Segments.hpp
@@ -18,6 +18,7 @@
 
 #pragma once
 
+#include <iterator>
 #include <sstream>
 
 #include "Common.hpp"
@@ -53,8 +54,11 @@ public:
     managed.push_back(str);
   }
 
-  class iterator : public std::iterator<std::input_iterator_tag, const char*> {
+  class iterator {
   public:
+    using iterator_category = std::input_iterator_tag;
+    using value_type = const char*;
+
     iterator(const Segments* const _segments, size_t _cursor)
         : segments(_segments), cursor(_cursor) {}