File indexing completed on 2025-01-30 09:59:43
0001 #ifndef BOOST_NUMERIC_SAFE_INTEGER_RANGE_HPP
0002 #define BOOST_NUMERIC_SAFE_INTEGER_RANGE_HPP
0003
0004
0005
0006
0007
0008
0009
0010 #include <cstdint> // intmax_t, uintmax_t
0011
0012 #include "utility.hpp"
0013 #include "safe_integer.hpp"
0014 #include "native.hpp"
0015 #include "exception_policies.hpp"
0016
0017
0018
0019
0020 namespace boost {
0021 namespace safe_numerics {
0022
0023
0024
0025
0026 template <
0027 std::intmax_t Min,
0028 std::intmax_t Max,
0029 class P = native,
0030 class E = default_exception_policy
0031 >
0032 using safe_signed_range = safe_base<
0033 typename utility::signed_stored_type<Min, Max>,
0034 static_cast<typename utility::signed_stored_type<Min, Max> >(Min),
0035 static_cast<typename utility::signed_stored_type<Min, Max> >(Max),
0036 P,
0037 E
0038 >;
0039
0040
0041
0042
0043 template <
0044 std::uintmax_t Min,
0045 std::uintmax_t Max,
0046 class P = native,
0047 class E = default_exception_policy
0048 >
0049 using safe_unsigned_range = safe_base<
0050 typename utility::unsigned_stored_type<Min, Max>,
0051 static_cast<typename utility::unsigned_stored_type<Min, Max> >(Min),
0052 static_cast<typename utility::unsigned_stored_type<Min, Max> >(Max),
0053 P,
0054 E
0055 >;
0056
0057 }
0058 }
0059
0060 #endif