mirror of
https://github.com/boostorg/iterator.git
synced 2025-05-10 07:33:53 +00:00
Added support for int128 to counting_iterator.
This commit is contained in:
parent
abe6fbfd4b
commit
eb0d01126a
@ -67,11 +67,21 @@ namespace detail
|
|||||||
|
|
||||||
# if defined(BOOST_HAS_LONG_LONG)
|
# if defined(BOOST_HAS_LONG_LONG)
|
||||||
template <>
|
template <>
|
||||||
struct is_numeric< ::boost::long_long_type>
|
struct is_numeric<boost::long_long_type>
|
||||||
: boost::true_type {};
|
: boost::true_type {};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct is_numeric< ::boost::ulong_long_type>
|
struct is_numeric<boost::ulong_long_type>
|
||||||
|
: boost::true_type {};
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# if defined(BOOST_HAS_INT128)
|
||||||
|
template <>
|
||||||
|
struct is_numeric<boost::int128_type>
|
||||||
|
: boost::true_type {};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct is_numeric<boost::uint128_type>
|
||||||
: boost::true_type {};
|
: boost::true_type {};
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@ -86,6 +96,21 @@ namespace detail
|
|||||||
typedef typename boost::detail::numeric_traits<T>::difference_type type;
|
typedef typename boost::detail::numeric_traits<T>::difference_type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# if defined(BOOST_HAS_INT128)
|
||||||
|
// std::numeric_limits, which is used by numeric_traits, is not specialized for __int128 in some standard libraries
|
||||||
|
template <>
|
||||||
|
struct numeric_difference<boost::int128_type>
|
||||||
|
{
|
||||||
|
typedef boost::int128_type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
struct numeric_difference<boost::uint128_type>
|
||||||
|
{
|
||||||
|
typedef boost::int128_type type;
|
||||||
|
};
|
||||||
|
# endif
|
||||||
|
|
||||||
template <class Incrementable, class CategoryOrTraversal, class Difference>
|
template <class Incrementable, class CategoryOrTraversal, class Difference>
|
||||||
struct counting_iterator_base
|
struct counting_iterator_base
|
||||||
{
|
{
|
||||||
|
@ -271,8 +271,12 @@ int main()
|
|||||||
test_integer<long>();
|
test_integer<long>();
|
||||||
test_integer<unsigned long>();
|
test_integer<unsigned long>();
|
||||||
#if defined(BOOST_HAS_LONG_LONG)
|
#if defined(BOOST_HAS_LONG_LONG)
|
||||||
test_integer< ::boost::long_long_type>();
|
test_integer<boost::long_long_type>();
|
||||||
test_integer< ::boost::ulong_long_type>();
|
test_integer<boost::ulong_long_type>();
|
||||||
|
#endif
|
||||||
|
#if defined(BOOST_HAS_INT128)
|
||||||
|
test_integer<boost::int128_type>();
|
||||||
|
test_integer<boost::uint128_type>();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Test user-defined type.
|
// Test user-defined type.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user