Skip to content

Commit b011a1e

Browse files
[Warnings] Removed Deprecated STD Iterator From Node Idx Iter
1 parent 75746eb commit b011a1e

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

libs/librrgraph/src/base/rr_node_impl.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,35 @@
33
// This file provides the inline proxy implemenation for t_rr_node.
44
// See the t_rr_node class comment for additional details.
55

6-
#include "rr_node_types.h"
6+
#include <cstddef>
7+
#include <iterator>
78
#include "rr_node.h"
89
#include "rr_graph_storage.h"
910

10-
class node_idx_iterator : public std::iterator<std::bidirectional_iterator_tag, const t_rr_node> {
11+
class node_idx_iterator {
1112
public:
13+
using iterator_category = std::bidirectional_iterator_tag;
14+
using difference_type = std::ptrdiff_t;
15+
using value_type = const t_rr_node;
16+
using pointer = value_type*;
17+
using reference = value_type&;
18+
1219
node_idx_iterator(t_rr_node value)
1320
: value_(value) {}
1421

15-
iterator operator++() {
22+
node_idx_iterator& operator++() {
1623
value_.next_node();
1724
return *this;
1825
}
19-
iterator operator--() {
26+
node_idx_iterator& operator--() {
2027
value_.prev_node();
2128
return *this;
2229
}
2330
reference operator*() const { return value_; }
2431
pointer operator->() const { return &value_; }
2532

26-
friend bool operator==(const node_idx_iterator lhs, const node_idx_iterator rhs) { return lhs.value_.id() == rhs.value_.id(); }
27-
friend bool operator!=(const node_idx_iterator lhs, const node_idx_iterator rhs) { return !(lhs == rhs); }
33+
friend bool operator==(const node_idx_iterator& lhs, const node_idx_iterator& rhs) { return lhs.value_.id() == rhs.value_.id(); }
34+
friend bool operator!=(const node_idx_iterator& lhs, const node_idx_iterator& rhs) { return !(lhs == rhs); }
2835

2936
private:
3037
t_rr_node value_;

0 commit comments

Comments
 (0)