Fix filter_iterator copy/converting constructor.

The constructed iterator would have an invalid end iterator because of
a typo in storage initialization.

Fixes https://github.com/boostorg/iterator/issues/92.
This commit is contained in:
Andrey Semashev
2025-05-24 23:19:45 +03:00
parent 6428e552e4
commit 1372e9afb6

View File

@ -104,7 +104,7 @@ public:
template< typename OtherIterator, typename = enable_if_convertible_t< OtherIterator, Iterator > >
filter_iterator(filter_iterator< Predicate, OtherIterator > const& t) :
super_t(t.base()), m_storage(t.m_storage.predicate(), m_storage.m_end)
super_t(t.base()), m_storage(t.m_storage.predicate(), t.m_storage.m_end)
{}
Predicate predicate() const { return m_storage.predicate(); }