25 Oct
2019
25 Oct
'19
10:16 a.m.
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. I would not set this compiler flag by hand, you can use b2 exception-handling=off. 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.