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.
This commit is contained in:
turlututututu 2022-09-02 23:51:30 +02:00 committed by karliss
parent d6370541e7
commit a2ed7971aa

View File

@ -71,8 +71,15 @@ private:
const RzPVector *const vec;
public:
class iterator : public std::iterator<std::input_iterator_tag, T *>
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<std::input_iterator_tag, T *>
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;