Boost C++ Libraries: Ticket #4131: Including boost/range/numeric.hpp causes compile errors without defining NDEBUG https://svn.boost.org/trac10/ticket/4131 <p> Although boost::inner_product in boost/range/numeric.hpp calls a function template boost::distance for static asserting, the header file has no statement to include boost/range/distance.hpp. Therefore, for example, the following code cannot be compiled without -DNDEBUG option. </p> <pre class="wiki">// test.cpp #include &lt;boost/range/numeric.hpp&gt; int main() { int array[3] = {0, 1, 2}; boost::accumulate(array, 0); return 0; } </pre><p> The errors are as follows; </p> <pre class="wiki">$ g++ --version g++ (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu4) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ g++ test.cpp In file included from test.cpp:1: include/boost/range/numeric.hpp: In function ‘Value boost::inner_product(const SinglePassRange1&amp;, const SinglePassRange2&amp;, Value)’: include/boost/range/numeric.hpp:59: error: ‘distance’ is not a member of ‘boost’ include/boost/range/numeric.hpp:59: error: ‘distance’ is not a member of ‘boost’ include/boost/range/numeric.hpp: In function ‘Value boost::inner_product(const SinglePassRange1&amp;, const SinglePassRange2&amp;, Value, BinaryOperation1, BinaryOperat ion2)’: include/boost/range/numeric.hpp:74: error: ‘distance’ is not a member of ‘boost’ include/boost/range/numeric.hpp:74: error: ‘distance’ is not a member of ‘boost’ $ g++ test.cpp -DNDEBUG </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4131 Trac 1.4.3 Neil Groves Sat, 17 Jul 2010 19:52:51 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4131#comment:1 https://svn.boost.org/trac10/ticket/4131#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> Ticket