From 6dd28c285261912e5d920977c4355fd11b44a697 Mon Sep 17 00:00:00 2001 From: Armand Zampieri Date: Thu, 19 Oct 2023 18:28:27 +0200 Subject: [PATCH] Corrected depreciation of Iterator --- include/tqdm/utils.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/include/tqdm/utils.h b/include/tqdm/utils.h index 34f7820..d4c69d8 100644 --- a/include/tqdm/utils.h +++ b/include/tqdm/utils.h @@ -52,15 +52,16 @@ template Wrapper for pointers and std containter iterators. @author Casper da Costa-Luis */ -class MyIteratorWrapper - : public std::iterator< - std::forward_iterator_tag, - typename std::iterator_traits<_Iterator>::value_type> { +class MyIteratorWrapper{ +public: + using iterator_category = std::forward_iterator_tag; + using value_type = typename std::iterator_traits<_Iterator>::value_type; + using difference_type = typename std::iterator_traits<_Iterator>::value_type; + using pointer = typename std::iterator_traits<_Iterator>::value_type*; + using reference = typename std::iterator_traits<_Iterator>::value_type&; + mutable _Iterator p; // TODO: remove this mutable -public: - // already done by std::iterator - typedef typename std::iterator_traits<_Iterator>::value_type value_type; explicit MyIteratorWrapper(_Iterator x) : p(x) {} // default construct gives end @@ -147,8 +148,13 @@ _MyIteratorWrapper myIteratorWrapper(_Iterator x) { } template -class RangeIterator - : public std::iterator { +class RangeIterator{ +public: + using iterator_category = std::forward_iterator_tag; + using value_type = IntType; + using difference_type = IntType; + using pointer = IntType*; + using reference = IntType&; private: mutable IntType current; IntType total;