Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Add iterator_*_t helpers for iterator traits.
Browse files Browse the repository at this point in the history
- iterator_value_t
- iterator_pointer_t
- iterator_reference_t
- iterator_difference_t
- iterator_system_t
  • Loading branch information
alliepiper committed Jan 6, 2021
1 parent 4fd1b54 commit 1469009
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions thrust/iterator/detail/iterator_traits.inl
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,36 @@ template<typename Iterator>
typedef typename thrust::iterator_traits<Iterator>::value_type type;
}; // end iterator_value

template <typename Iterator>
using iterator_value_t = typename iterator_value<Iterator>::type;

template<typename Iterator>
struct iterator_pointer
{
typedef typename thrust::iterator_traits<Iterator>::pointer type;
}; // end iterator_pointer

template <typename Iterator>
using iterator_pointer_t = typename iterator_pointer<Iterator>::type;

template<typename Iterator>
struct iterator_reference
{
typedef typename iterator_traits<Iterator>::reference type;
}; // end iterator_reference

template <typename Iterator>
using iterator_reference_t = typename iterator_reference<Iterator>::type;

template<typename Iterator>
struct iterator_difference
{
typedef typename thrust::iterator_traits<Iterator>::difference_type type;
}; // end iterator_difference

template <typename Iterator>
using iterator_difference_t = typename iterator_difference<Iterator>::type;

namespace detail
{

Expand Down Expand Up @@ -90,6 +99,8 @@ template<>
typedef thrust::iterator_system<const int*>::type type;
}; // end iterator_system<void*>

template <typename Iterator>
using iterator_system_t = typename iterator_system<Iterator>::type;

template <typename Iterator>
struct iterator_traversal
Expand Down

0 comments on commit 1469009

Please sign in to comment.