Subject: [Boost-bugs] [Boost C++ Libraries] #5486: adjacent_filtered_range::m_pred should be removed
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-18 13:29:10
#5486: adjacent_filtered_range::m_pred should be removed
------------------------------+---------------------------------------------
Reporter: iorate | Owner: neilgroves
Type: Patches | Status: new
Milestone: To Be Determined | Component: range
Version: Boost 1.46.1 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
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.
{{{
#!diff
===================================================================
--- adjacent_filtered.hpp
+++ adjacent_filtered.hpp (working copy)
@@ -143,10 +143,6 @@
skip_iter(boost::end(r), boost::end(r), p))
{
}
-
- private:
- P m_pred;
- R* m_range;
};
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.
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5486> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC