]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | diff --git a/core/base/iterator_factory.hpp b/core/base/iterator_factory.hpp |
2 | index b7efd21dfe..5e4bddeb17 100644 | |
3 | --- a/core/base/iterator_factory.hpp | |
4 | +++ b/core/base/iterator_factory.hpp | |
5 | @@ -110,7 +110,7 @@ class IteratorFactory { | |
6 | ||
7 | ~Reference() {} | |
8 | ||
9 | - Reference(IteratorFactory &parent, array_index_type array_index) | |
10 | + Reference(IteratorFactory *parent, array_index_type array_index) | |
11 | : parent_(parent), arr_index_(array_index) | |
12 | {} | |
13 | ||
14 | @@ -143,10 +143,10 @@ class IteratorFactory { | |
15 | { | |
16 | // In C++11, it is legal for a nested class to access private | |
17 | // members of the parent class. | |
18 | - parent_.dominant_values_[arr_index_] = | |
19 | - std::move(other.parent_.dominant_values_[other.arr_index_]); | |
20 | - parent_.secondary_values_[arr_index_] = | |
21 | - std::move(other.parent_.secondary_values_[other.arr_index_]); | |
22 | + parent_->dominant_values_[arr_index_] = | |
23 | + std::move(other.parent_->dominant_values_[other.arr_index_]); | |
24 | + parent_->secondary_values_[arr_index_] = | |
25 | + std::move(other.parent_->secondary_values_[other.arr_index_]); | |
26 | return *this; | |
27 | } | |
28 | ||
29 | @@ -174,25 +174,25 @@ class IteratorFactory { | |
30 | return left.dominant < right.dominant(); | |
31 | } | |
32 | ||
33 | - ToSortType &dominant() { return parent_.dominant_values_[arr_index_]; } | |
34 | + ToSortType &dominant() { return parent_->dominant_values_[arr_index_]; } | |
35 | ||
36 | const ToSortType &dominant() const | |
37 | { | |
38 | - return parent_.dominant_values_[arr_index_]; | |
39 | + return parent_->dominant_values_[arr_index_]; | |
40 | } | |
41 | ||
42 | SecondaryType &secondary() | |
43 | { | |
44 | - return parent_.secondary_values_[arr_index_]; | |
45 | + return parent_->secondary_values_[arr_index_]; | |
46 | } | |
47 | ||
48 | const SecondaryType &secondary() const | |
49 | { | |
50 | - return parent_.secondary_values_[arr_index_]; | |
51 | + return parent_->secondary_values_[arr_index_]; | |
52 | } | |
53 | ||
54 | private: | |
55 | - IteratorFactory &parent_; | |
56 | + IteratorFactory *parent_; | |
57 | array_index_type arr_index_; | |
58 | }; | |
59 | ||
60 | @@ -214,9 +214,11 @@ class IteratorFactory { | |
61 | using reference = Reference; | |
62 | using iterator_category = std::random_access_iterator_tag; | |
63 | ||
64 | + Iterator() = default; | |
65 | + | |
66 | ~Iterator() {} | |
67 | ||
68 | - Iterator(IteratorFactory &parent, difference_type array_index) | |
69 | + Iterator(IteratorFactory *parent, difference_type array_index) | |
70 | : parent_(parent), arr_index_(array_index) | |
71 | {} | |
72 | ||
73 | @@ -298,12 +300,12 @@ class IteratorFactory { | |
74 | } | |
75 | ||
76 | // Comparable operators | |
77 | - bool operator==(const Iterator &other) | |
78 | + bool operator==(const Iterator &other) const | |
79 | { | |
80 | return arr_index_ == other.arr_index_; | |
81 | } | |
82 | ||
83 | - bool operator!=(const Iterator &other) | |
84 | + bool operator!=(const Iterator &other) const | |
85 | { | |
86 | return arr_index_ != other.arr_index_; | |
87 | } | |
88 | @@ -329,8 +331,8 @@ class IteratorFactory { | |
89 | } | |
90 | ||
91 | private: | |
92 | - IteratorFactory &parent_; | |
93 | - difference_type arr_index_; | |
94 | + IteratorFactory *parent_{}; | |
95 | + difference_type arr_index_{}; | |
96 | }; | |
97 | ||
98 | public: | |
99 | @@ -363,7 +365,7 @@ class IteratorFactory { | |
100 | * Creates an iterator pointing to the beginning of both arrays | |
101 | * @returns an iterator pointing to the beginning of both arrays | |
102 | */ | |
103 | - Iterator begin() { return {*this, 0}; } | |
104 | + Iterator begin() { return {this, 0}; } | |
105 | ||
106 | /** | |
107 | * Creates an iterator pointing to the (excluding) end of both arrays | |
108 | @@ -371,7 +373,7 @@ class IteratorFactory { | |
109 | */ | |
110 | Iterator end() | |
111 | { | |
112 | - return {*this, static_cast<typename Iterator::difference_type>(size_)}; | |
113 | + return {this, static_cast<typename Iterator::difference_type>(size_)}; | |
114 | } | |
115 | ||
116 | private: | |
117 |