[Boost-bugs] [Boost C++ Libraries] #3995: array breaks with BOOST_NO_EXCEPTIONS and BOOST_EXCEPTION_DISABLE

Subject: [Boost-bugs] [Boost C++ Libraries] #3995: array breaks with BOOST_NO_EXCEPTIONS and BOOST_EXCEPTION_DISABLE
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-03-10 11:20:51


#3995: array breaks with BOOST_NO_EXCEPTIONS and BOOST_EXCEPTION_DISABLE
---------------------------------------------------+------------------------
 Reporter: peter.myerscough-jackopson@… | Owner:
     Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: None
  Version: Boost 1.42.0 | Severity: Problem
 Keywords: |
---------------------------------------------------+------------------------
 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.

 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.

 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.
 {{{
 -171 throw std::out_of_range("array<>: index out of
 range");
 +171 std::out_of_range e("array<>: index out of range");
 +172 boost::throw_exception(e);
 }}}


 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.

 Ps. should I have to be defining BOOST_EXCEPTION_DISABLE??

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3995>
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:02 UTC