diff --git a/thrust/thrust/iterator/zip_iterator.h b/thrust/thrust/iterator/zip_iterator.h index ffcb8ef3139..d24d20cd15d 100644 --- a/thrust/thrust/iterator/zip_iterator.h +++ b/thrust/thrust/iterator/zip_iterator.h @@ -325,14 +325,15 @@ inline _CCCL_HOST_DEVICE zip_iterator<_CUDA_VSTD::tuple> 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 -struct iterator_traits> +struct iterator_traits> { - using It = thrust::zip_iterator; + using It = THRUST_NS_QUALIFIER::zip_iterator; using value_type = typename It::value_type; using reference = typename It::reference; using iterator_category = typename It::iterator_category;