File indexing completed on 2025-01-30 09:59:41
0001 #ifndef BOOST_NUMERIC_CONCEPT_SAFE_NUMERIC_HPP
0002 #define BOOST_NUMERIC_CONCEPT_SAFE_NUMERIC_HPP
0003
0004
0005
0006
0007
0008
0009
0010 #include <limits>
0011 #include <typetraits>
0012 #include <boost/concept/usage.hpp>
0013 #include "boost/safe_numerics/concept/safe_numeric.hpp"
0014
0015 namespace boost {
0016 namespace safe_numerics {
0017
0018 template<class T>
0019 struct SafeNumeric : public Numeric<T> {
0020 BOOST_CONCEPT_USAGE(SafeNumeric<T>){
0021 using t1 = get_exception_policy<T>;
0022 using t2 = get_promotion_policy<T>;
0023 using t3 = base_type<T>;
0024 }
0025 constexpr static bool value = is_safe<T>::value && Numeric<T>::value ;
0026 constexpr operator bool (){
0027 return value;
0028 }
0029 };
0030
0031 }
0032 }
0033
0034 #endif