From 8c01469b3c546c88df769fec127d54f186ac50ea Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sat, 29 Nov 2003 18:19:24 +0000 Subject: [PATCH] Fixes for libs without numeric_limits specializations. [SVN r21006] --- include/boost/iterator/counting_iterator.hpp | 26 ++++++++++++-------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/include/boost/iterator/counting_iterator.hpp b/include/boost/iterator/counting_iterator.hpp index d44be21..0a55967 100644 --- a/include/boost/iterator/counting_iterator.hpp +++ b/include/boost/iterator/counting_iterator.hpp @@ -34,20 +34,11 @@ namespace detail # ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS -# if defined(BOOST_HAS_LONG_LONG) - BOOST_STATIC_CONSTANT( - bool, value = ( - std::numeric_limits::is_specialized - | boost::is_same::value - | boost::is_same::value - )); -# else BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits::is_specialized); -# endif # else -# if !defined(__BORLANDC__) +# if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) BOOST_STATIC_CONSTANT( bool, value = ( boost::is_convertible::value @@ -64,6 +55,21 @@ namespace detail struct is_numeric : mpl::bool_<(::boost::detail::is_numeric_impl::value)> {}; + +# if defined(BOOST_HAS_LONG_LONG) + template <> + struct is_numeric + : mpl::true_ {}; + + template <> + struct is_numeric + : mpl::true_ {}; +# endif + + // Some compilers fail to have a numeric_limits specialization + template <> + struct is_numeric + : mpl::true_ {}; template struct numeric_difference