Fixed compilation of filter_iterator conversion constructor.

The constructor would attempt to access a private member of the source
iterator, which could have a different type and therefore have that
member inaccessible. Also, the storage forwarding constructor had incorrect
types used in the forwarding expressions, which caused further compilation
errors.

Fixes https://github.com/boostorg/iterator/issues/90.
This commit is contained in:
Andrey Semashev 2025-04-02 00:09:36 +03:00
parent eee670608e
commit 1a7996ebd0

View File

@ -46,6 +46,9 @@ class filter_iterator :
{
friend class iterator_core_access;
template< typename, typename >
friend class filter_iterator;
private:
using super_t = detail::filter_iterator_base_t< Predicate, Iterator >;
@ -75,7 +78,7 @@ private:
template< typename Pred, typename Iter >
storage(Pred&& pred, Iter&& end) :
predicate_base(boost::empty_init_t{}, static_cast< Predicate&& >(pred)), m_end(static_cast< Iterator&& >(end))
predicate_base(boost::empty_init_t{}, static_cast< Pred&& >(pred)), m_end(static_cast< Iter&& >(end))
{
}