From 4547e989ea5062fb3fc8101b7e9532b4e0bc17b8 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 12 Mar 2022 22:22:00 +0100 Subject: [PATCH] PyCXX: remove use of std::iterator that is deprecated since C++17 --- src/CXX/Python3/Objects.hxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/CXX/Python3/Objects.hxx b/src/CXX/Python3/Objects.hxx index 09533e3c9b..415a191ac8 100644 --- a/src/CXX/Python3/Objects.hxx +++ b/src/CXX/Python3/Objects.hxx @@ -1442,8 +1442,14 @@ namespace Py } class PYCXX_EXPORT iterator - : public random_access_iterator_parent( seqref ) { + public: + using iterator_category = std::random_access_iterator_tag; + using value_type = seqref; + using difference_type = int; + using pointer = value_type*; + using reference = value_type&; + protected: friend class SeqBase; SeqBase *seq; @@ -1595,8 +1601,14 @@ namespace Py } class PYCXX_EXPORT const_iterator - : public random_access_iterator_parent( const Object ) { + public: + using iterator_category = std::random_access_iterator_tag; + using value_type = const Object; + using difference_type = int; + using pointer = value_type*; + using reference = value_type&; + protected: friend class SeqBase; const SeqBase *seq;