Skip to content

Commit 1a7996e

Browse files
committed
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 #90.
1 parent eee6706 commit 1a7996e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

include/boost/iterator/filter_iterator.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class filter_iterator :
4646
{
4747
friend class iterator_core_access;
4848

49+
template< typename, typename >
50+
friend class filter_iterator;
51+
4952
private:
5053
using super_t = detail::filter_iterator_base_t< Predicate, Iterator >;
5154

@@ -75,7 +78,7 @@ class filter_iterator :
7578

7679
template< typename Pred, typename Iter >
7780
storage(Pred&& pred, Iter&& end) :
78-
predicate_base(boost::empty_init_t{}, static_cast< Predicate&& >(pred)), m_end(static_cast< Iterator&& >(end))
81+
predicate_base(boost::empty_init_t{}, static_cast< Pred&& >(pred)), m_end(static_cast< Iter&& >(end))
7982
{
8083
}
8184

0 commit comments

Comments
 (0)