Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:51:37

0001 #ifndef BOOST_NUMERIC_SAFE_COMMON_HPP
0002 #define BOOST_NUMERIC_SAFE_COMMON_HPP
0003 
0004 //  Copyright (c) 2012 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 <type_traits>
0011 
0012 namespace boost {
0013 namespace safe_numerics {
0014 
0015 // default implementations for required meta-functions
0016 template<typename T>
0017 struct is_safe : public std::false_type
0018 {};
0019 
0020 template<typename T>
0021 struct base_type {
0022     using type = T;
0023 };
0024 
0025 template<class T>
0026 constexpr const typename base_type<T>::type & base_value(const T & t) {
0027     return static_cast<const typename base_type<T>::type & >(t);
0028 }
0029 
0030 template<typename T>
0031 struct get_promotion_policy {
0032     using type = void;
0033 };
0034 
0035 template<typename T>
0036 struct get_exception_policy {
0037     using type = void;
0038 };
0039 
0040 
0041 } // safe_numerics
0042 } // boost
0043 
0044 #endif // BOOST_NUMERIC_SAFE_COMMON_HPP