mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
workaround for no c++11 numeric_limits
This commit is contained in:
parent
ce16e24637
commit
7a1974742a
110 changed files with 727 additions and 436 deletions
|
@ -2,8 +2,8 @@
|
|||
#define SPROUT_DETAIL_INTEGER_HPP
|
||||
|
||||
#include <climits>
|
||||
#include <limits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/limits.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace detail {
|
||||
|
@ -115,11 +115,11 @@ namespace sprout {
|
|||
{
|
||||
typedef typename sprout::detail::int_least_helper<
|
||||
0
|
||||
+ (Bits - 1 <= std::numeric_limits<long long>::digits)
|
||||
+ (Bits - 1 <= std::numeric_limits<long>::digits)
|
||||
+ (Bits - 1 <= std::numeric_limits<int>::digits)
|
||||
+ (Bits - 1 <= std::numeric_limits<short>::digits)
|
||||
+ (Bits - 1 <= std::numeric_limits<signed char>::digits)
|
||||
+ (Bits - 1 <= sprout::numeric_limits<long long>::digits)
|
||||
+ (Bits - 1 <= sprout::numeric_limits<long>::digits)
|
||||
+ (Bits - 1 <= sprout::numeric_limits<int>::digits)
|
||||
+ (Bits - 1 <= sprout::numeric_limits<short>::digits)
|
||||
+ (Bits - 1 <= sprout::numeric_limits<signed char>::digits)
|
||||
>::least least;
|
||||
typedef typename sprout::detail::int_fast_t<least>::type fast;
|
||||
};
|
||||
|
@ -129,11 +129,11 @@ namespace sprout {
|
|||
{
|
||||
typedef typename sprout::detail::int_least_helper<
|
||||
5
|
||||
+ (Bits <= std::numeric_limits<unsigned long long>::digits)
|
||||
+ (Bits <= std::numeric_limits<unsigned long>::digits)
|
||||
+ (Bits <= std::numeric_limits<unsigned int>::digits)
|
||||
+ (Bits <= std::numeric_limits<unsigned short>::digits)
|
||||
+ (Bits <= std::numeric_limits<unsigned char>::digits)
|
||||
+ (Bits <= sprout::numeric_limits<unsigned long long>::digits)
|
||||
+ (Bits <= sprout::numeric_limits<unsigned long>::digits)
|
||||
+ (Bits <= sprout::numeric_limits<unsigned int>::digits)
|
||||
+ (Bits <= sprout::numeric_limits<unsigned short>::digits)
|
||||
+ (Bits <= sprout::numeric_limits<unsigned char>::digits)
|
||||
>::least least;
|
||||
typedef typename sprout::detail::int_fast_t<least>::type fast;
|
||||
};
|
||||
|
@ -142,11 +142,11 @@ namespace sprout {
|
|||
struct int_max_value_t {
|
||||
typedef typename sprout::detail::int_least_helper<
|
||||
0
|
||||
+ (MaxValue <= std::numeric_limits<long long>::max())
|
||||
+ (MaxValue <= std::numeric_limits<long>::max())
|
||||
+ (MaxValue <= std::numeric_limits<int>::max())
|
||||
+ (MaxValue <= std::numeric_limits<short>::max())
|
||||
+ (MaxValue <= std::numeric_limits<signed char>::max())
|
||||
+ (MaxValue <= sprout::numeric_limits<long long>::max())
|
||||
+ (MaxValue <= sprout::numeric_limits<long>::max())
|
||||
+ (MaxValue <= sprout::numeric_limits<int>::max())
|
||||
+ (MaxValue <= sprout::numeric_limits<short>::max())
|
||||
+ (MaxValue <= sprout::numeric_limits<signed char>::max())
|
||||
>::least least;
|
||||
typedef typename sprout::detail::int_fast_t<least>::type fast;
|
||||
};
|
||||
|
@ -154,11 +154,11 @@ namespace sprout {
|
|||
struct int_min_value_t {
|
||||
typedef typename sprout::detail::int_least_helper<
|
||||
0
|
||||
+ (MinValue >= std::numeric_limits<long long>::min())
|
||||
+ (MinValue >= std::numeric_limits<long>::min())
|
||||
+ (MinValue >= std::numeric_limits<int>::min())
|
||||
+ (MinValue >= std::numeric_limits<short>::min())
|
||||
+ (MinValue >= std::numeric_limits<signed char>::min())
|
||||
+ (MinValue >= sprout::numeric_limits<long long>::min())
|
||||
+ (MinValue >= sprout::numeric_limits<long>::min())
|
||||
+ (MinValue >= sprout::numeric_limits<int>::min())
|
||||
+ (MinValue >= sprout::numeric_limits<short>::min())
|
||||
+ (MinValue >= sprout::numeric_limits<signed char>::min())
|
||||
>::least least;
|
||||
typedef typename sprout::detail::int_fast_t<least>::type fast;
|
||||
};
|
||||
|
@ -167,11 +167,11 @@ namespace sprout {
|
|||
struct uint_value_t {
|
||||
typedef typename sprout::detail::int_least_helper<
|
||||
5
|
||||
+ (MaxValue <= std::numeric_limits<long long>::max())
|
||||
+ (MaxValue <= std::numeric_limits<long>::max())
|
||||
+ (MaxValue <= std::numeric_limits<int>::max())
|
||||
+ (MaxValue <= std::numeric_limits<short>::max())
|
||||
+ (MaxValue <= std::numeric_limits<signed char>::max())
|
||||
+ (MaxValue <= sprout::numeric_limits<long long>::max())
|
||||
+ (MaxValue <= sprout::numeric_limits<long>::max())
|
||||
+ (MaxValue <= sprout::numeric_limits<int>::max())
|
||||
+ (MaxValue <= sprout::numeric_limits<short>::max())
|
||||
+ (MaxValue <= sprout::numeric_limits<signed char>::max())
|
||||
>::least least;
|
||||
typedef typename sprout::detail::int_fast_t<least>::type fast;
|
||||
};
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include <cstddef>
|
||||
#include <climits>
|
||||
#include <limits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/limits.hpp>
|
||||
#include <sprout/detail/integer.hpp>
|
||||
|
||||
namespace sprout {
|
||||
|
@ -33,9 +33,9 @@ namespace sprout {
|
|||
|
||||
#define SPROUT_LOW_BITS_MASK_SPECIALIZE(Type) \
|
||||
template<> \
|
||||
struct low_bits_mask_t<std::numeric_limits<Type>::digits> { \
|
||||
struct low_bits_mask_t<sprout::numeric_limits<Type>::digits> { \
|
||||
public: \
|
||||
typedef std::numeric_limits<Type> limits_type; \
|
||||
typedef sprout::numeric_limits<Type> limits_type; \
|
||||
typedef typename sprout::detail::uint_t<limits_type::digits>::least least; \
|
||||
typedef typename sprout::detail::uint_t<limits_type::digits>::fast fast; \
|
||||
public: \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue