File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
include/boost/safe_numerics Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ target_compile_features(boost_safe_numerics INTERFACE cxx_std_14)
18
18
# Compiler settings - special settings for known compilers
19
19
#
20
20
21
+ set (CMAKE_CXX_STANDARD 14 )
22
+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
23
+ set (CMAKE_CXX_EXTENSIONS OFF )
24
+
21
25
message (STATUS "compiler is ${CMAKE_CXX_COMPILER_ID} " )
22
26
23
27
if ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
Original file line number Diff line number Diff line change 8
8
// http://www.boost.org/LICENSE_1_0.txt)
9
9
10
10
#include < boost/mp11.hpp>
11
-
11
+ # include < boost/config.hpp > // BOOST_NO_EXCEPTIONS
12
12
#include " exception.hpp"
13
13
14
14
namespace boost {
@@ -55,16 +55,20 @@ struct ignore_exception {
55
55
constexpr ignore_exception (const safe_numerics_error &, const char * ){}
56
56
};
57
57
58
+ // emit compile time error if this is invoked.
59
+ struct trap_exception {};
60
+
58
61
// If an exceptional condition is detected at runtime throw the exception.
59
62
struct throw_exception {
63
+ #ifndef BOOST_NO_EXCEPTIONS
60
64
throw_exception (const safe_numerics_error & e, const char * message){
61
65
throw std::system_error (std::error_code (e), message);
62
66
}
67
+ #else
68
+ trap_exception (const safe_numerics_error & e, const char * message);
69
+ #endif
63
70
};
64
71
65
- // emit compile time error if this is invoked.
66
- struct trap_exception {};
67
-
68
72
// given an error code - return the action code which it corresponds to.
69
73
constexpr safe_numerics_actions
70
74
make_safe_numerics_action (const safe_numerics_error & e){
You can’t perform that action at this time.
0 commit comments