Skip to content

Commit

Permalink
Removes this-> in starmap::iterator functions.
Browse files Browse the repository at this point in the history
clang was getting confused by them, I don't know why.
  • Loading branch information
ryanhaining committed Apr 8, 2016
1 parent 386c2b3 commit 4f332be
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions starmap.hpp
Expand Up @@ -10,6 +10,8 @@
#include <cassert>
#include <memory>

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

decltype(auto) operator*() {
return call_with_tuple(*this->func, *this->sub_iter);
return call_with_tuple(*func, *sub_iter);
}

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

decltype(auto) operator*() {
return callers[this->index](*this->func, *this->tup);
return callers[index](*func, *tup);
}

auto operator -> () -> ArrowProxy<decltype(**this)> {
return {**this};
}

Iterator& operator++() {
++this->index;
++index;
return *this;
}

Expand All @@ -158,7 +160,7 @@ class iter::impl::TupleStarMapper {
}

bool operator!=(const Iterator& other) const {
return this->index != other.index;
return index != other.index;
}

bool operator==(const Iterator& other) const {
Expand Down

0 comments on commit 4f332be

Please sign in to comment.