Skip to content

Commit

Permalink
Remove uses of std::iterator (deprecated in C++17) (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeterre authored Mar 29, 2020
1 parent 120863b commit 26faac3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/yaml-cpp/node/detail/node_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ struct node_iterator_type<const V> {
};

template <typename V>
class node_iterator_base
: public std::iterator<std::forward_iterator_tag, node_iterator_value<V>,
std::ptrdiff_t, node_iterator_value<V>*,
node_iterator_value<V>> {
class node_iterator_base {
private:
struct enabler {};

Expand All @@ -68,9 +65,13 @@ class node_iterator_base
};

public:
using iterator_category = std::forward_iterator_tag;
using value_type = node_iterator_value<V>;
using difference_type = std::ptrdiff_t;
using pointer = node_iterator_value<V>*;
using reference = node_iterator_value<V>;
using SeqIter = typename node_iterator_type<V>::seq;
using MapIter = typename node_iterator_type<V>::map;
using value_type = node_iterator_value<V>;

node_iterator_base()
: m_type(iterator_type::NoneType), m_seqIt(), m_mapIt(), m_mapEnd() {}
Expand Down

0 comments on commit 26faac3

Please sign in to comment.