From 77a3ed56a7b7326814ea5d37214bec1d88ec334e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 2 Mar 2022 00:14:09 +0800 Subject: [PATCH] include/xlist: define iterator without std::iterator<> std::iterator<> is deprecated in C++17, so let's just define the required traits directly. Signed-off-by: Kefu Chai --- src/include/xlist.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/include/xlist.h b/src/include/xlist.h index 733a318a9bd73..3c04312c714a4 100644 --- a/src/include/xlist.h +++ b/src/include/xlist.h @@ -159,10 +159,15 @@ public: remove(_back); } - class iterator: std::iterator { + class iterator { private: item *cur; public: + using iterator_category = std::forward_iterator_tag; + using value_type = T; + using difference_type = std::ptrdiff_t; + using pointer = T*; + using reference = T&; iterator(item *i = 0) : cur(i) {} T operator*() { return static_cast(cur->_item); } iterator& operator++() { -- 2.39.5