diff options
Diffstat (limited to 'devel/boost/files/limits')
-rw-r--r-- | devel/boost/files/limits | 266 |
1 files changed, 0 insertions, 266 deletions
diff --git a/devel/boost/files/limits b/devel/boost/files/limits deleted file mode 100644 index 5b6af1d399e..00000000000 --- a/devel/boost/files/limits +++ /dev/null @@ -1,266 +0,0 @@ -/* $NetBSD: limits,v 1.1 2000/05/12 06:15:06 jlam Exp $ - * - * This file is a part of the ISO C++ standard, but is not present in current - * versions of NetBSD. The contents of this file should probably be wrapped - * in a check for the appropriate version of the GNU C++ compiler or library. - */ - -#ifndef STD_LIMITS -#define STD_LIMITS - -#include <cfloat> -#include <climits> - -namespace std { - -template <class T> -class numeric_limits { -public: - typedef T numeric_type; - - static const bool is_specialized = false; -}; - -template <> -class numeric_limits<char> { -public: - typedef char numeric_type; - - static const bool is_specialized = true; - - static const int digits = sizeof (numeric_type) * CHAR_BIT; - - static const bool is_signed = (CHAR_MIN == SCHAR_MIN); - static const bool is_integer = true; - static const bool is_exact = true; - - inline static numeric_type min() throw() { return CHAR_MIN; } - inline static numeric_type max() throw() { return CHAR_MAX; } -}; - -template <> -class numeric_limits<signed char> { -public: - typedef char numeric_type; - - static const bool is_specialized = true; - - static const int digits = sizeof (numeric_type) * CHAR_BIT; - - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - - inline static numeric_type min() throw() { return SCHAR_MIN; } - inline static numeric_type max() throw() { return SCHAR_MAX; } -}; - -template <> -class numeric_limits<unsigned char> { -public: - typedef unsigned char numeric_type; - - static const bool is_specialized = true; - - static const int digits = sizeof (numeric_type) * CHAR_BIT; - - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - - inline static numeric_type min() throw() { return 0; } - inline static numeric_type max() throw() { return UCHAR_MAX; } -}; - -template <> -class numeric_limits<short> { -public: - typedef short numeric_type; - - static const bool is_specialized = true; - - static const int digits = sizeof (numeric_type) * CHAR_BIT; - - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - - inline static numeric_type min() throw() { return SHRT_MIN; } - inline static numeric_type max() throw() { return SHRT_MAX; } -}; - -template <> -class numeric_limits<unsigned short> { -public: - typedef short numeric_type; - - static const bool is_specialized = true; - - static const int digits = sizeof (numeric_type) * CHAR_BIT; - - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - - inline static numeric_type min() throw() { return 0; } - inline static numeric_type max() throw() { return USHRT_MAX; } -}; - -template <> -class numeric_limits<int> { -public: - typedef int numeric_type; - - static const bool is_specialized = true; - - static const int digits = sizeof (numeric_type) * CHAR_BIT; - - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - - inline static numeric_type min() throw() { return INT_MIN; } - inline static numeric_type max() throw() { return INT_MAX; } -}; - -template <> -class numeric_limits<unsigned int> { -public: - typedef unsigned int numeric_type; - - static const bool is_specialized = true; - - static const int digits = sizeof (numeric_type) * CHAR_BIT; - - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - - inline static numeric_type min() throw() { return 0; } - inline static numeric_type max() throw() { return UINT_MAX; } -}; - -template <> -class numeric_limits<long> { -public: - typedef long numeric_type; - - static const bool is_specialized = true; - - static const int digits = sizeof (numeric_type) * CHAR_BIT; - - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - - inline static numeric_type min() throw() { return LONG_MIN; } - inline static numeric_type max() throw() { return LONG_MAX; } -}; - -template <> -class numeric_limits<unsigned long> { -public: - typedef unsigned long numeric_type; - - static const bool is_specialized = true; - - static const int digits = sizeof (numeric_type) * CHAR_BIT; - - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - - inline static numeric_type min() throw() { return 0; } - inline static numeric_type max() throw() { return ULONG_MAX; } -}; - -template <> -class numeric_limits<long long> { -public: - typedef long long numeric_type; - - static const bool is_specialized = true; - - static const int digits = sizeof (numeric_type) * CHAR_BIT; - - static const bool is_signed = true; - static const bool is_integer = true; - static const bool is_exact = true; - - inline static numeric_type min() throw() { return LLONG_MIN; } - inline static numeric_type max() throw() { return LLONG_MAX; } -}; - -template <> -class numeric_limits<unsigned long long> { -public: - typedef unsigned long long numeric_type; - - static const bool is_specialized = true; - - static const int digits = sizeof (numeric_type) * CHAR_BIT; - - static const bool is_signed = false; - static const bool is_integer = true; - static const bool is_exact = true; - - inline static numeric_type min() throw() { return 0; } - inline static numeric_type max() throw() { return ULLONG_MAX; } -}; - -template <> -class numeric_limits<float> { -public: - typedef float numeric_type; - - static const bool is_specialized = true; - - static const int radix = FLT_RADIX; - static const int digits = FLT_MANT_DIG; - static const int digits10 = FLT_DIG; - - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - - inline static numeric_type min() throw() { return FLT_MIN; } - inline static numeric_type max() throw() { return FLT_MAX; } - - inline static numeric_type epsilon() throw() { return FLT_EPSILON; } - - static const int min_exponent = FLT_MIN_EXP; - static const int min_exponent10 = FLT_MIN_10_EXP; - static const int max_exponent = FLT_MAX_EXP; - static const int max_exponent10 = FLT_MAX_10_EXP; - - static const bool has_infinity = false; -}; - -template <> -class numeric_limits<double> { -public: - typedef double numeric_type; - - static const bool is_specialized = true; - - static const int digits = DBL_MANT_DIG; - static const int digits10 = DBL_DIG; - - static const bool is_signed = true; - static const bool is_integer = false; - static const bool is_exact = false; - - inline static numeric_type min() throw() { return DBL_MIN; } - inline static numeric_type max() throw() { return DBL_MAX; } - - inline static numeric_type epsilon() throw() { return DBL_EPSILON; } - - static const int min_exponent = DBL_MIN_EXP; - static const int min_exponent10 = DBL_MIN_10_EXP; - static const int max_exponent = DBL_MAX_EXP; - static const int max_exponent10 = DBL_MAX_10_EXP; -}; - -} // namespace std - -#endif // STD_LIMITS |