Boost C++ Libraries: Ticket #3995: array breaks with BOOST_NO_EXCEPTIONS and BOOST_EXCEPTION_DISABLE https://svn.boost.org/trac10/ticket/3995 <p> I am using boost in the TI Code composer studio environment for an embedded platform which is does not support exceptions. I have therefore had to define BOOST_NO_EXCEPTIONS and BOOST_EXCEPTION_DISABLE to compile with boost::array, BUT I have also had to fix a bug in the use of exceptions. </p> <p> On line 171 in array.hpp there is a std::out_of_range exception thrown using the throw statement. This causes an error due to exceptions not being defined. </p> <p> Further down in the partial specialisation for zero sized arrays, on lines 285-286 another exception is created and thrown using boost::throw_exception. This does not cause an error. The patch therefore is to allow boost::array to be compiled without errors with exceptions disabled. </p> <pre class="wiki">-171 throw std::out_of_range("array&lt;&gt;: index out of range"); +171 std::out_of_range e("array&lt;&gt;: index out of range"); +172 boost::throw_exception(e); </pre><p> It may be more useful to consider putting #ifdef BOOST_NO_EXCEPTIONS around rangecheck(...) to ensure that the function does not get called with BOOST_NO_EXCEPTION, because it will not have any effect. </p> <p> Ps. should I have to be defining BOOST_EXCEPTION_DISABLE?? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3995 Trac 1.4.3 anonymous Wed, 10 Mar 2010 12:22:19 GMT component, type changed; keywords, owner set https://svn.boost.org/trac10/ticket/3995#comment:1 https://svn.boost.org/trac10/ticket/3995#comment:1 <ul> <li><strong>keywords</strong> array BOOST_NO_EXCEPTIONS BOOST_EXCEPTION_DISABLE added </li> <li><strong>owner</strong> set to <span class="trac-author">No-Maintainer</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">array</span> </li> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Patches</span> </li> </ul> Ticket Marshall Clow Wed, 10 Mar 2010 14:24:43 GMT owner changed https://svn.boost.org/trac10/ticket/3995#comment:2 https://svn.boost.org/trac10/ticket/3995#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">No-Maintainer</span> to <span class="trac-author">Marshall Clow</span> </li> </ul> <p> I have updated the trunk as of revision <a class="missing ticket">#60417</a>. After the tests have cycled a few times, I will merge to the release branch. </p> Ticket Marshall Clow Wed, 10 Mar 2010 14:25:04 GMT status changed https://svn.boost.org/trac10/ticket/3995#comment:3 https://svn.boost.org/trac10/ticket/3995#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Marshall Clow Thu, 25 Mar 2010 15:58:40 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3995#comment:4 https://svn.boost.org/trac10/ticket/3995#comment:4 <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> <p> Migrated to release branch in revision 60824 </p> Ticket