Back to home page

EIC code displayed by LXR

 
 

    


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 //  Copyright (c) 2015 Robert Ramey
0005 //
0006 // Distributed under the Boost Software License, Version 1.0. (See
0007 // accompanying file LICENSE_1_0.txt or copy at
0008 // http://www.boost.org/LICENSE_1_0.txt)
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 } // safe_numerics
0032 } // boost
0033 
0034 #endif // BOOST_NUMERIC_CONCEPT_SAFE_NUMERIC_HPP