diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index a3790b5..b387c43 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -24,6 +24,7 @@ foreach(file_name ${example_list}) add_executable(${base_name} ${file_name}) add_test(NAME ${base_name} COMMAND ${base_name}) set_target_properties(${base_name} PROPERTIES FOLDER "example") + target_compile_options(${base_name} PUBLIC "-std=c++14") endforeach(file_name) set_target_properties(example84 PROPERTIES diff --git a/examples/example91.cpp b/examples/example91.cpp index 3c7aa90..e432b05 100644 --- a/examples/example91.cpp +++ b/examples/example91.cpp @@ -47,7 +47,7 @@ using safe_bool_t = boost::numeric::safe_unsigned_range< >; #define DESKTOP -#include "motor1.c" +#include "Motor1.c" #include #include diff --git a/include/exception_policies.hpp b/include/exception_policies.hpp index fdde825..0f5a0f7 100644 --- a/include/exception_policies.hpp +++ b/include/exception_policies.hpp @@ -25,12 +25,12 @@ namespace numeric { // this would emulate the normal C/C++ behavior of permitting overflows // and the like. struct ignore_exception { - static void no_error(const char * message) {} - static void uninitialized_error(const char * message) {} - static void overflow_error(const char * message) {} - static void underflow_error(const char * message) {} - static void range_error(const char * message) {} - static void domain_error(const char * message) {} + static void no_error(const char *) {} + static void uninitialized_error(const char *) {} + static void overflow_error(const char *) {} + static void underflow_error(const char *) {} + static void range_error(const char *) {} + static void domain_error(const char *) {} }; // example - if you want to specify specific behavior for particular exception @@ -70,7 +70,7 @@ struct no_exception_support { // If an exceptional condition is detected at runtime throw the exception. // map our exception list to the ones in stdexcept struct throw_exception { - static void no_error(const char * message) { + static void no_error(const char *) { } static void unintialized_error(const char * message) { throw std::invalid_argument(message); diff --git a/include/interval.hpp b/include/interval.hpp index 6dc356c..172a851 100644 --- a/include/interval.hpp +++ b/include/interval.hpp @@ -402,7 +402,7 @@ constexpr bool operator!=( const interval & t, const interval & u ){ - return ! t == u; + return ! (t == u); } template diff --git a/include/safe_base.hpp b/include/safe_base.hpp index da5ed26..87fe939 100644 --- a/include/safe_base.hpp +++ b/include/safe_base.hpp @@ -165,7 +165,7 @@ class safe_base { > friend class safe_base; - friend class std::numeric_limits< + friend struct std::numeric_limits< safe_base >; @@ -280,7 +280,7 @@ template< class P, class E > -class numeric_limits > +struct numeric_limits > : public std::numeric_limits { using SB = boost::numeric::safe_base; diff --git a/include/safe_base_operations.hpp b/include/safe_base_operations.hpp index c786573..1abf232 100644 --- a/include/safe_base_operations.hpp +++ b/include/safe_base_operations.hpp @@ -1301,7 +1301,6 @@ typename boost::lazy_enable_if_c< constexpr inline operator|(const T & t, const U & u){ using bwr = bitwise_or_result; using result_base_type = typename bwr::result_base_type; - using exception_policy = typename bwr::exception_policy; const checked_result r = checked::bitwise_or( @@ -1370,7 +1369,6 @@ typename boost::lazy_enable_if_c< constexpr inline operator&(const T & t, const U & u){ using bwr = bitwise_and_result; using result_base_type = typename bwr::result_base_type; - using exception_policy = typename bwr::exception_policy; const checked_result r = checked::bitwise_and( @@ -1407,7 +1405,6 @@ typename boost::lazy_enable_if_c< constexpr inline operator^(const T & t, const U & u){ using bwr = bitwise_or_result; using result_base_type = typename bwr::result_base_type; - using exception_policy = typename bwr::exception_policy; const checked_result r = checked::bitwise_xor(t, u); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f0a057d..a0f8592 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -23,6 +23,7 @@ foreach(file_name ${test_list}) add_executable(${base_name} ${file_name}) add_test(NAME ${base_name} COMMAND ${base_name}) set_target_properties(${base_name} PROPERTIES FOLDER "tests") + target_compile_options(${base_name} PUBLIC "-std=c++14") endforeach(file_name) # end test targets