Skip to content

Commit

Permalink
Fix Barry's filter_view bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyCarter committed Dec 24, 2018
1 parent 814b4f6 commit f007c59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/stl2/view/filter.hpp
Expand Up @@ -159,7 +159,7 @@ STL2_OPEN_NAMESPACE {
public:
__sentinel() = default;
explicit constexpr __sentinel(filter_view& parent)
: end_(__stl2::end(parent)) {}
: end_(__stl2::end(parent.base_)) {}

constexpr sentinel_t<V> base() const
{ return end_; }
Expand Down
5 changes: 5 additions & 0 deletions test/view/filter_view.cpp
Expand Up @@ -134,5 +134,10 @@ int main() {
CHECK(sum == 4);
}

{
auto yes = [](int){ return true; };
(void) (view::iota(0) | view::filter(yes));
}

return test_result();
}

0 comments on commit f007c59

Please sign in to comment.