From f007c595bd8c421faa08779561bdbd2930c38171 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Mon, 24 Dec 2018 15:48:39 -0800 Subject: [PATCH] Fix Barry's filter_view bug --- include/stl2/view/filter.hpp | 2 +- test/view/filter_view.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/stl2/view/filter.hpp b/include/stl2/view/filter.hpp index 85e25b786..da108d8ba 100644 --- a/include/stl2/view/filter.hpp +++ b/include/stl2/view/filter.hpp @@ -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 base() const { return end_; } diff --git a/test/view/filter_view.cpp b/test/view/filter_view.cpp index 59543ee61..20a683610 100644 --- a/test/view/filter_view.cpp +++ b/test/view/filter_view.cpp @@ -134,5 +134,10 @@ int main() { CHECK(sum == 4); } + { + auto yes = [](int){ return true; }; + (void) (view::iota(0) | view::filter(yes)); + } + return test_result(); }