dyninst/dyninst-warning-fix-std-iterator-is-deprecated-1394.patch
WizardHowl 41fe9a43a6 warning fix: std::iterator is deprecated
Signed-off-by: WizardHowl <liuwenyu7@huawei.com>
2023-08-09 10:55:30 +08:00

35 lines
1.2 KiB
Diff

From 55d8a338e362d3aa4448aa9bae776eb90ca1292a Mon Sep 17 00:00:00 2001
From: "James A. Kupsch" <kupsch@cs.wisc.edu>
Date: Thu, 16 Feb 2023 10:11:59 -0600
Subject: [PATCH] warning fix: std::iterator is deprecated (#1394)
- replace std::iterator with in class type aliass for required types
---
symtabAPI/h/Symtab.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/symtabAPI/h/Symtab.h b/symtabAPI/h/Symtab.h
index 7731c1572..bf6d8ab23 100644
--- a/symtabAPI/h/Symtab.h
+++ b/symtabAPI/h/Symtab.h
@@ -558,9 +558,15 @@ class SYMTAB_EXPORT Symtab : public LookupInterface,
void erase(Symbol* s);
// Iterator for the symbols. Do not use in parallel.
- class iterator : public std::iterator<std::forward_iterator_tag,Symbol*> {
+ class iterator {
master_t::iterator m;
public:
+ using iterator_category = std::forward_iterator_tag;
+ using value_type = Symbol*;
+ using difference_type = std::ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type&;
+
iterator(master_t::iterator i) : m(i) {}
bool operator==(const iterator& x) { return m == x.m; }
bool operator!=(const iterator& x) { return !operator==(x); }
--
2.21.0.windows.1