[Boost-users] {exception][boost::throw_exception][BOOST_NO_EXCEPTIONS] implications
The project I've joined [ab]uses BOOST_NO_EXCEPTIONS in 1.55b as a means to intercept exceptions thrown via boost::throw_exception() and translate them to the project's single exception type derived from std::exception, leaving me a bit queasy. That queasiness is reinforced by #ifdef BOOST_NO_EXCEPTIONS #error This header requires exception handling to be enabled. #endif in ...\boost_1_55_0b1\boost\exception\detail\exception_ptr.hpp. This implies that BOOST_NO_EXCEPTIONS is used for more that just allowing client code to supply it's own throw_exception. Does boost and/or C++ provide a better customization point to safely translate exceptions thrown by boost? (note: we're using vs2013, generally the latest gcc, and clang) Thanks, Jeff
On Mon, Oct 28, 2013 at 8:22 AM, Jeff Flinn
#ifdef BOOST_NO_EXCEPTIONS #error This header requires exception handling to be enabled. #endif
in ...\boost_1_55_0b1\boost\exception\detail\exception_ptr.hpp. This implies that BOOST_NO_EXCEPTIONS is used for more that just allowing client code to supply it's own throw_exception.
BOOST_NO_EXCEPTIONS disables exception handling in Boost. See http://www.boost.org/doc/libs/release/libs/exception/doc/configuration_macro....
Does boost and/or C++ provide a better customization point to safely translate exceptions thrown by boost?
No. If you really want to do this (translating exception types is usually a bad idea) you can edit boost/throw_exception.hpp to suit your needs. Emil Dotchevski
participants (2)
-
Emil Dotchevski
-
Jeff Flinn