Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help the ranges concepts recognize standard contiguous iterators in c++14/17 #3202

Merged
merged 10 commits into from
Dec 21, 2024
19 changes: 11 additions & 8 deletions libcudacxx/include/cuda/std/__iterator/iterator_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,24 +170,23 @@ struct __iter_traits_cache
template <class _Iter>
using _ITER_TRAITS = typename __iter_traits_cache<_Iter>::type;

#if defined(_GLIBCXX_DEBUG)
#if _CCCL_STD_VER >= 2014
# if defined(_GLIBCXX_DEBUG)
_CCCL_TEMPLATE(class _Iter, class _Ty, class _Range)
_CCCL_REQUIRES(_IsSame<_Iter, ::__gnu_debug::_Safe_iterator<_Ty*, _Range>>::value)
_LIBCUDACXX_HIDE_FROM_ABI auto
__iter_concept_fn(::__gnu_debug::_Safe_iterator<_Ty*, _Range>, __priority_tag<3>) -> contiguous_iterator_tag;
#endif
#if defined(__GLIBCXX__)
# endif
# if defined(__GLIBCXX__)
_CCCL_TEMPLATE(class _Iter, class _Ty, class _Range)
_CCCL_REQUIRES(_IsSame<_Iter, ::__gnu_cxx::__normal_iterator<_Ty*, _Range>>::value)
_LIBCUDACXX_HIDE_FROM_ABI auto
__iter_concept_fn(::__gnu_cxx::__normal_iterator<_Ty*, _Range>, __priority_tag<3>) -> contiguous_iterator_tag;
#endif
#if defined(_LIBCPP_VERSION)
# elif defined(_LIBCPP_VERSION)
ericniebler marked this conversation as resolved.
Show resolved Hide resolved
_CCCL_TEMPLATE(class _Iter, class _Ty)
_CCCL_REQUIRES(_IsSame<_Iter, ::std::__wrap_iter<_Ty*>>::value)
_LIBCUDACXX_HIDE_FROM_ABI auto __iter_concept_fn(::std::__wrap_iter<_Ty*>, __priority_tag<3>) -> contiguous_iterator_tag;
#endif
#if defined(_MSVC_STL_VERSION) || defined(_IS_WRS)
# elif defined(_MSVC_STL_VERSION) || defined(_IS_WRS)
_CCCL_TEMPLATE(class _Iter)
_CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_Array_iterator>::value)
_LIBCUDACXX_HIDE_FROM_ABI auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag;
Expand All @@ -209,10 +208,14 @@ _LIBCUDACXX_HIDE_FROM_ABI auto __iter_concept_fn(_Iter, __priority_tag<3>) -> co
_CCCL_TEMPLATE(class _Iter)
_CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_String_view_iterator>::value)
_LIBCUDACXX_HIDE_FROM_ABI auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag;
#endif
_CCCL_TEMPLATE(class _Iter)
_CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_Span_iterator>::value)
_LIBCUDACXX_HIDE_FROM_ABI auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag;
ericniebler marked this conversation as resolved.
Show resolved Hide resolved
# endif
_CCCL_TEMPLATE(class _Iter, class _Ty)
_CCCL_REQUIRES(_IsSame<_Iter, _Ty*>::value)
_LIBCUDACXX_HIDE_FROM_ABI auto __iter_concept_fn(_Ty*, __priority_tag<3>) -> contiguous_iterator_tag;
#endif // _CCCL_STD_VER >= 2014
template <class _Iter>
_LIBCUDACXX_HIDE_FROM_ABI auto
__iter_concept_fn(_Iter, __priority_tag<2>) -> class _ITER_TRAITS<_Iter>::iterator_concept;
Expand Down
Loading