Boost C++ Libraries: Ticket #5486: adjacent_filtered_range::m_pred should be removed https://svn.boost.org/trac10/ticket/5486 <p> boost::range_detail::adjacent_filtered_range&lt;P, R, default_pass&gt;::m_pred is not only unused, but also inhibits instantiation of the class when P is not default constructible. </p> <pre class="wiki">rng | boost::adaptors::adjacent_filtered(std::not2(pred)); // error </pre><p> I think m_pred and m_range (which is also unused) should be removed. </p> <div class="wiki-code"> <div class="diff"> <ul class="entries"> <li class="entry"> <h2> <a>adjacent_filtered.hpp</a> </h2> <table class="trac-diff inline" cellspacing="0"> <colgroup> <col class="lineno"/><col class="lineno"/><col class="content"/> </colgroup> <thead> <tr> <th title="File adjacent_filtered.hpp"> </th> <th title="File adjacent_filtered.hpp (working copy)"> </th> <td> <em></em> &nbsp; </td> </tr> </thead> <tbody class="unmod"> <tr> <th>143</th><th>143</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;skip_iter(boost::end(r), boost::end(r), p))</span></td> </tr> <tr> <th>144</th><th>144</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</span></td> </tr> <tr> <th>145</th><th>145</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span></td> </tr> </tbody> <tbody class="rem"> <tr class="first"> <th>146</th><th>&nbsp;</th><td class="l"><del></del></td> </tr> <tr class=""> <th>147</th><th>&nbsp;</th><td class="l"><del>&nbsp; &nbsp; &nbsp; &nbsp; private:</del></td> </tr> <tr class=""> <th>148</th><th>&nbsp;</th><td class="l"><del>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P m_pred;</del></td> </tr> <tr class="last"> <th>149</th><th>&nbsp;</th><td class="l"><del>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; R* m_range;</del></td> </tr> </tbody> <tbody class="unmod"> <tr> <th>150</th><th>146</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; };</span></td> </tr> <tr> <th>151</th><th>147</th><td class="l"><span></span></td> </tr> <tr> <th>152</th><th>148</th><td class="l"><span>&nbsp; &nbsp; &nbsp; &nbsp; template&lt; class T &gt;</span></td> </tr> </tbody> </table> </li> </ul> </div></div><p> (When P is not default constructible, the instance of skip_iterator is degraded to an input iterator, but the same goes for filter_iterator.) </p> <p> In case m_pred is not removed, the reference of adjacent_filtered should be modified. </p> <p> Change: </p> <pre class="wiki">Throws: Whatever the copy constructor of bi_pred might throw. </pre><p> To: </p> <pre class="wiki">Throws: Whatever the copy constructor and default constructor of bi_pred might throw. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5486 Trac 1.4.3 Neil Groves Sun, 22 May 2011 20:34:50 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5486#comment:1 https://svn.boost.org/trac10/ticket/5486#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> 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! </p> Ticket