Skip to content

Commit 4f332be

Browse files
committed
Removes this-> in starmap::iterator functions.
clang was getting confused by them, I don't know why.
1 parent 386c2b3 commit 4f332be

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

starmap.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <cassert>
1111
#include <memory>
1212

13+
//NOTE I don't know why, but clang gets very confused by having this-> in the
14+
//Iterators' member functions
1315
namespace iter {
1416
namespace impl {
1517
template <typename Func, typename Container>
@@ -80,7 +82,7 @@ class iter::impl::StarMapper {
8082
}
8183

8284
decltype(auto) operator*() {
83-
return call_with_tuple(*this->func, *this->sub_iter);
85+
return call_with_tuple(*func, *sub_iter);
8486
}
8587

8688
auto operator -> () -> ArrowProxy<decltype(**this)> {
@@ -139,15 +141,15 @@ class iter::impl::TupleStarMapper {
139141
: func{&f}, tup{&t}, index{i} {}
140142

141143
decltype(auto) operator*() {
142-
return callers[this->index](*this->func, *this->tup);
144+
return callers[index](*func, *tup);
143145
}
144146

145147
auto operator -> () -> ArrowProxy<decltype(**this)> {
146148
return {**this};
147149
}
148150

149151
Iterator& operator++() {
150-
++this->index;
152+
++index;
151153
return *this;
152154
}
153155

@@ -158,7 +160,7 @@ class iter::impl::TupleStarMapper {
158160
}
159161

160162
bool operator!=(const Iterator& other) const {
161-
return this->index != other.index;
163+
return index != other.index;
162164
}
163165

164166
bool operator==(const Iterator& other) const {

0 commit comments

Comments
 (0)