Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Mar 6, 2025
1 parent 74f68f4 commit dad67ba
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions thrust/thrust/iterator/counting_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,8 @@ class counting_iterator;
namespace detail
{
template <typename Number>
using counting_iterator_difference_type = ::cuda::std::_If<
::cuda::std::is_integral_v<Number>,
// the difference between two int values can be larger than what an int can represent
::cuda::std::_If<sizeof(Number) < sizeof(int), int, ::cuda::std::ptrdiff_t>,
// floating points use ptrdiff_t
::cuda::std::_If<::cuda::std::is_floating_point_v<Number>,
::cuda::std::ptrdiff_t,
// any other type, if it can represent the difference, can be used as difference type,
// otherwise also ptrdiff_t
::cuda::std::_If<::cuda::std::numeric_limits<Number>::is_signed
&& (!::cuda::std::numeric_limits<Number>::is_bounded
|| ::cuda::std::numeric_limits<Number>::digits
> ::cuda::std::numeric_limits<::cuda::std::ptrdiff_t>::digits),
Number,
::cuda::std::ptrdiff_t>>>;
using counting_iterator_difference_type =
::cuda::std::_If<::cuda::std::is_integral_v<Number> && sizeof(Number) < sizeof(int), int, ::cuda::std::ptrdiff_t>;

template <typename Incrementable, typename System, typename Traversal, typename Difference>
struct make_counting_iterator_base
Expand Down

0 comments on commit dad67ba

Please sign in to comment.