Skip to content

Commit

Permalink
reason and fix for zip traits
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Feb 25, 2025
1 parent c0a503f commit 12f1bc0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions thrust/thrust/iterator/zip_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,15 @@ inline _CCCL_HOST_DEVICE zip_iterator<_CUDA_VSTD::tuple<Iterators...>> make_zip_

THRUST_NAMESPACE_END

// TODO(bgruber): libcu++ iterator traits fail for complex zip_iterators in C++17, see e.g.:
// https://godbolt.org/z/7jb4qG3bb
// libcu++ iterator traits fail for complex zip_iterators in C++17, see e.g.: https://godbolt.org/z/7jb4qG3bb
// The reason is that libcu++ backported the C++20 range iterator machinery to C++17, but C++17 has slightly different
// language rules, especially regarding `void`. We deemed to it too hard to work around the issues.
#if _CCCL_STD_VER < 2020
_LIBCUDACXX_BEGIN_NAMESPACE_STD
template <typename IteratorTuple>
struct iterator_traits<thrust::zip_iterator<IteratorTuple>>
struct iterator_traits<THRUST_NS_QUALIFIER::zip_iterator<IteratorTuple>>
{
using It = thrust::zip_iterator<IteratorTuple>;
using It = THRUST_NS_QUALIFIER::zip_iterator<IteratorTuple>;
using value_type = typename It::value_type;
using reference = typename It::reference;
using iterator_category = typename It::iterator_category;
Expand Down

0 comments on commit 12f1bc0

Please sign in to comment.