Skip to content

Commit

Permalink
Fixes reference type in product
Browse files Browse the repository at this point in the history
Issue #88
  • Loading branch information
ryanhaining committed Aug 18, 2022
1 parent 5e8ddb3 commit 038a436
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions product.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class iter::impl::Productor {
using value_type = TupleDeref<TupleTypeT>;
using difference_type = std::ptrdiff_t;
using pointer = value_type*;
using reference = value_type&;
using reference = value_type;

IteratorTempl(IteratorTuple<TupleTypeT>&& iters,
IteratorTuple<TupleTypeT>&& end_iters)
Expand Down Expand Up @@ -148,7 +148,7 @@ class iter::impl::Productor {
return {(*std::get<Is>(iters_))...};
}

auto operator-> () -> ArrowProxy<decltype(**this)> {
auto operator->() -> ArrowProxy<decltype(**this)> {
return {**this};
}
};
Expand Down
1 change: 1 addition & 0 deletions test/test_product.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ TEST_CASE("product: iterator meets requirements", "[product]") {
std::string s{"abc"};
auto c = product(s, s);
REQUIRE(itertest::IsIterator<decltype(std::begin(c))>::value);
REQUIRE(itertest::ReferenceMatchesDeref<decltype(std::begin(c))>::value);
}

template <typename... Ts>
Expand Down

0 comments on commit 038a436

Please sign in to comment.