On 10/25/19 3:16 AM, Hans Dembinski via Boost wrote:
On 24. Oct 2019, at 18:47, Robert Ramey via Boost
wrote: I want to detect whether or not the -no_exception compile time flag has been used on gcc/clang. Will BOOST_NO_EXCEPTIONS do this? If not is there something I can use?
Yes, it does.
Hmmm - I've written a small test which seems to show that it doesn't.
#include
I would not set this compiler flag by hand, you can use b2 exception-handling=off.
Hmmm - I would not think it's a good idea to make a library component dependent on the user using b2 to build it.
If you use the BOOST_THROW_EXCEPTION macro, you normally do not need to use BOOST_NO_EXCEPTIONS directly. I use BOOST_NO_EXCEPTIONS in some unit tests of throws to avoid warnings about unused variables. Often it is not needed there as well. BOOST_TEST_THROW from boost/core/lightweight_test.hpp automatically expands to a nothing when BOOST_NO_EXCEPTIONS is set, for example.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost