Opened 12 years ago
Closed 11 years ago
#5486 closed Patches (fixed)
adjacent_filtered_range::m_pred should be removed
Reported by: | iorate | Owned by: | Neil Groves |
---|---|---|---|
Milestone: | To Be Determined | Component: | range |
Version: | Boost 1.46.1 | Severity: | Problem |
Keywords: | Cc: |
Description
boost::range_detail::adjacent_filtered_range<P, R, default_pass>::m_pred is not only unused, but also inhibits instantiation of the class when P is not default constructible.
rng | boost::adaptors::adjacent_filtered(std::not2(pred)); // error
I think m_pred and m_range (which is also unused) should be removed.
-
adjacent_filtered.hpp
143 143 skip_iter(boost::end(r), boost::end(r), p)) 144 144 { 145 145 } 146 147 private:148 P m_pred;149 R* m_range;150 146 }; 151 147 152 148 template< class T >
(When P is not default constructible, the instance of skip_iterator is degraded to an input iterator, but the same goes for filter_iterator.)
In case m_pred is not removed, the reference of adjacent_filtered should be modified.
Change:
Throws: Whatever the copy constructor of bi_pred might throw.
To:
Throws: Whatever the copy constructor and default constructor of bi_pred might throw.
Note:
See TracTickets
for help on using tickets.
Thank you for the report. The offending unnecessary variables have been removed. The change has been committed to the trunk, and a suitable level of shame felt!