mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
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:
parent
d6370541e7
commit
a2ed7971aa
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user