Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-03-08 08:17:43


"Lars Gullik Bjønnes" wrote:
> In cpp_regex_traits.cpp line 76 there is a re-throw. This does not
> work when compiling without exceptions. [...]

> To allow compiling I did this:
>
> --- ../../boost/boost/throw_exception.hpp 2004-08-05
> 17:24:43.000000000 +0200 +++ boost/throw_exception.hpp 2005-03-08
> 03:04:27.066704153 +0100 @@ -32,6 +32,8 @@
>
> void throw_exception(std::exception const & e); // user defined
>
> +#define BOOST_THROW_EXCEPTION_AGAIN

throw_exception.hpp doesn't contain helper TRY/CATCH/RETHROW macros for two
reasons:

1. Most non-g++ compilers accept the exception handling constructs in "no
exceptions" mode;

2. The proper way to fix code that relies on catch(...)+throw is to
introduce a RAII guard. This also helps with other catch(...)-related
problems.

This reminds me that I need to fix shared_count.hpp to not contain a
rethrow.

However, last time we discussed the issue, it was pointed out that the RAII
way has performance implications compared to catch(...)+throw. This lead to
detail/no_exception_support.hpp, which does contain a BOOST_RETHROW macro.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk