From a2ed7971aad8946b4cdf93a540c27255e8f5b654 Mon Sep 17 00:00:00 2001 From: turlututututu Date: Fri, 2 Sep 2022 23:51:30 +0200 Subject: [PATCH] Update iterator synthax to be compatible with cpp17 (#3033) std::iterator is deprecated in cpp17 thus in order to be able to upgrade to cpp17 if needed we manually define the relevant types for iterator. See https://www.fluentcpp.com/2018/05/08/std-iterator-deprecated/ for more details. --- src/core/RizinCpp.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/core/RizinCpp.h b/src/core/RizinCpp.h index ae4fcb03..e39f964b 100644 --- a/src/core/RizinCpp.h +++ b/src/core/RizinCpp.h @@ -71,8 +71,15 @@ private: const RzPVector *const vec; public: - class iterator : public std::iterator + class iterator { + public: + using iterator_category = std::input_iterator_tag; + using value_type = T *; + using difference_type = ptrdiff_t; + using pointer = T **; + using reference = T *&; + private: T **p; @@ -107,8 +114,15 @@ private: const RzList *const list; public: - class iterator : public std::iterator + class iterator { + public: + using iterator_category = std::input_iterator_tag; + using value_type = T *; + using difference_type = ptrdiff_t; + using pointer = T **; + using reference = T *&; + private: RzListIter *iter;