+ // integer templates specifying extreme value ----------------------------//
+
+ // signed
+#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
+ template< boost::long_long_type MaxValue > // maximum value to require support
+#else
+ template< long MaxValue > // maximum value to require support
+#endif
+ struct int_max_value_t
+ {
+ typedef typename detail::int_least_helper
+ <
+#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
+ (MaxValue <= ::boost::integer_traits<boost::long_long_type>::const_max) +
+#else
+ 1 +
+#endif
+ (MaxValue <= ::boost::integer_traits<long>::const_max) +
+ (MaxValue <= ::boost::integer_traits<int>::const_max) +
+ (MaxValue <= ::boost::integer_traits<short>::const_max) +
+ (MaxValue <= ::boost::integer_traits<signed char>::const_max)
+ >::least least;
+ typedef typename int_fast_t<least>::type fast;
+ };
+
+#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
+ template< boost::long_long_type MinValue > // minimum value to require support
+#else
+ template< long MinValue > // minimum value to require support
+#endif
+ struct int_min_value_t
+ {
+ typedef typename detail::int_least_helper
+ <
+#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
+ (MinValue >= ::boost::integer_traits<boost::long_long_type>::const_min) +
+#else
+ 1 +
+#endif
+ (MinValue >= ::boost::integer_traits<long>::const_min) +
+ (MinValue >= ::boost::integer_traits<int>::const_min) +
+ (MinValue >= ::boost::integer_traits<short>::const_min) +
+ (MinValue >= ::boost::integer_traits<signed char>::const_min)
+ >::least least;
+ typedef typename int_fast_t<least>::type fast;
+ };
+
+ // unsigned
+#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
+ template< boost::ulong_long_type MaxValue > // minimum value to require support
+#else
+ template< unsigned long MaxValue > // minimum value to require support
+#endif
+ struct uint_value_t
+ {
+#if (defined(__BORLANDC__) || defined(__CODEGEAR__))
+ // It's really not clear why this workaround should be needed... shrug I guess! JM
+#if defined(BOOST_NO_INTEGRAL_INT64_T)
+ BOOST_STATIC_CONSTANT(unsigned, which =
+ 6 +
+ (MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
+ (MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
+ (MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
+ (MaxValue <= ::boost::integer_traits<unsigned char>::const_max));
+ typedef typename detail::int_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
+#else // BOOST_NO_INTEGRAL_INT64_T
+ BOOST_STATIC_CONSTANT(unsigned, which =
+ 5 +
+ (MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
+ (MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
+ (MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
+ (MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
+ (MaxValue <= ::boost::integer_traits<unsigned char>::const_max));
+ typedef typename detail::int_least_helper< ::boost::uint_value_t<MaxValue>::which>::least least;
+#endif // BOOST_NO_INTEGRAL_INT64_T
+#else
+ typedef typename detail::int_least_helper
+ <
+ 5 +
+#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG)
+ (MaxValue <= ::boost::integer_traits<boost::ulong_long_type>::const_max) +
+#else
+ 1 +
+#endif
+ (MaxValue <= ::boost::integer_traits<unsigned long>::const_max) +
+ (MaxValue <= ::boost::integer_traits<unsigned int>::const_max) +
+ (MaxValue <= ::boost::integer_traits<unsigned short>::const_max) +
+ (MaxValue <= ::boost::integer_traits<unsigned char>::const_max)
+ >::least least;
+#endif
+ typedef typename int_fast_t<least>::type fast;
+ };