From 55ee565496137ace733aabed2c6003855762d3d6 Mon Sep 17 00:00:00 2001 From: divyegala Date: Fri, 16 Jul 2021 17:28:50 -0700 Subject: [PATCH] directly inherit from std::iterator_traits --- thrust/iterator/iterator_traits.h | 50 +------------------------------ 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/thrust/iterator/iterator_traits.h b/thrust/iterator/iterator_traits.h index 5a33658c2..38289dca6 100644 --- a/thrust/iterator/iterator_traits.h +++ b/thrust/iterator/iterator_traits.h @@ -38,59 +38,11 @@ namespace thrust { -namespace detail -{ - -template -struct iterator_traits_impl {}; - -template -struct iterator_traits_impl< - T -, typename voider< - typename T::difference_type - , typename T::value_type - , typename T::pointer - , typename T::reference - , typename T::iterator_category - >::type -> -{ - typedef typename T::difference_type difference_type; - typedef typename T::value_type value_type; - typedef typename T::pointer pointer; - typedef typename T::reference reference; - typedef typename T::iterator_category iterator_category; -}; - -} // namespace detail - /*! \p iterator_traits is a type trait class that provides a uniform * interface for querying the properties of iterators at compile-time. */ template -struct iterator_traits : detail::iterator_traits_impl {}; - -// traits are specialized for pointer types -template - struct iterator_traits -{ - typedef std::ptrdiff_t difference_type; - typedef T value_type; - typedef T* pointer; - typedef T& reference; - typedef std::random_access_iterator_tag iterator_category; -}; - -template - struct iterator_traits -{ - typedef std::ptrdiff_t difference_type; - typedef T value_type; - typedef const T* pointer; - typedef const T& reference; - typedef std::random_access_iterator_tag iterator_category; -}; // end iterator_traits +struct iterator_traits : std::iterator_traits {}; template struct iterator_value;