Boost logo

Boost :

Subject: [boost] [numeric] Applying trivial bugfix
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2012-02-22 15:14:56


There are a lot of feature requests to support compilation with
disabled exceptions #5731, #5076, #5393, #5800.

Fix is trivial and well known: replace throw x; with
BOOST_THROW_EXCEPTION(x); in a converter_policies.hpp file. But the
library maintainer does not like BOOST_THROW_EXCEPTION because of code

Can I apply another trivial fix:

struct def_overflow_handler


  void operator() ( range_check_result r ) //



    if ( r == cNegOverflow )

      throw negative_overflow() ;

    else if ( r == cPosOverflow )

           throw positive_overflow() ;


    if ( r == cNegOverflow )

      ::boost::throw_exception(negative_overflow()) ;

    else if ( r == cPosOverflow )

           ::boost::throw_exception(positive_overflow()) ;



} ;

Adding this will fix all the tickets and allow some of the dependent
libraries to build with disabled exceptions.

Boost.Lexical_cast tests will cover Boost.Numeric usage cases with
disabled exceptions.

Best regards,

Antony Polukhin

Boost list run by bdawes at, gregod at, cpdaniel at, john at