Boost C++ Libraries: Ticket #9524: assertions in range-based inner_product will change behavior https://svn.boost.org/trac10/ticket/9524 <p> In range/numeric.hpp, in <code>inner_product</code>, I see the following assertion: </p> <pre class="wiki">BOOST_ASSERT( boost::distance(rng2) &gt;= boost::distance(rng1) ); </pre><p> A good idea in theory. But <code>rng2</code> and <code>rng1</code> can be input ranges. Simply computing the distance will consume the input that the algorithms needs. </p> <p> Drop the assertions. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9524 Trac 1.4.3 Neil Groves Fri, 21 Feb 2014 20:31:35 GMT status changed https://svn.boost.org/trac10/ticket/9524#comment:1 https://svn.boost.org/trac10/ticket/9524#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Neil Groves Fri, 21 Feb 2014 20:32:13 GMT <link>https://svn.boost.org/trac10/ticket/9524#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9524#comment:2</guid> <description> <p> I'll drop the assertions for the case where the traversal is &lt; bidirectional. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Neil Groves</dc:creator> <pubDate>Thu, 27 Feb 2014 16:54:08 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9524#comment:3 https://svn.boost.org/trac10/ticket/9524#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket