Skip to content

Commit

Permalink
remove _CCCL_CONSTEXPR_CXX14/17 (#3793)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbusato authored Feb 13, 2025
1 parent 98a3c79 commit c27d887
Show file tree
Hide file tree
Showing 152 changed files with 998 additions and 1,092 deletions.
2 changes: 0 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ AlwaysBreakTemplateDeclarations: Yes
AttributeMacros: [
'_CCCL_ALIGNAS_TYPE',
'_CCCL_ALIGNAS',
'_CCCL_CONSTEXPR_CXX14',
'_CCCL_CONSTEXPR_CXX17',
'_CCCL_CONSTEXPR_CXX20',
'_CCCL_CONSTEXPR_CXX23',
'_CCCL_DEVICE',
Expand Down
4 changes: 2 additions & 2 deletions cub/cub/thread/thread_reduce.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ _CCCL_NODISCARD _CCCL_DEVICE constexpr bool enable_sm70_simd_reduction()
}

template <typename Input, typename ReductionOp, typename AccumT>
_CCCL_NODISCARD _CCCL_DEVICE _CCCL_FORCEINLINE _CCCL_CONSTEXPR_CXX14 bool enable_simd_reduction()
_CCCL_NODISCARD _CCCL_DEVICE _CCCL_FORCEINLINE constexpr bool enable_simd_reduction()
{
using cub::detail::is_one_of;
using ::cuda::std::is_same;
Expand Down Expand Up @@ -428,7 +428,7 @@ struct enable_ternary_reduction_sm90<__nv_bfloat162, ReductionOp>
# endif // _CCCL_HAS_NVBF16()

template <typename Input, typename ReductionOp, typename AccumT>
_CCCL_NODISCARD _CCCL_DEVICE _CCCL_FORCEINLINE _CCCL_CONSTEXPR_CXX14 bool enable_ternary_reduction()
_CCCL_NODISCARD _CCCL_DEVICE _CCCL_FORCEINLINE constexpr bool enable_ternary_reduction()
{
using cub::detail::is_one_of;
using ::cuda::std::is_same;
Expand Down
4 changes: 0 additions & 4 deletions docs/cccl_development/macro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,6 @@ The following macros are required only if the target C++ version does not suppor
+-----------------------------+----------------------------------------------------------+
| ``_CCCL_STD_VER`` | C++ standard version, e.g. ``#if _CCCL_STD_VER >= 2017`` |
+-----------------------------+----------------------------------------------------------+
| ``_CCCL_CONSTEXPR_CXX14`` | Enable ``constexpr`` for C++14 or newer |
+-----------------------------+----------------------------------------------------------+
| ``_CCCL_CONSTEXPR_CXX17`` | Enable ``constexpr`` for C++17 or newer |
+-----------------------------+----------------------------------------------------------+
| ``_CCCL_CONSTEXPR_CXX20`` | Enable ``constexpr`` for C++20 or newer |
+-----------------------------+----------------------------------------------------------+
| ``_CCCL_CONSTEXPR_CXX23`` | Enable ``constexpr`` for C++23 or newer |
Expand Down
10 changes: 5 additions & 5 deletions libcudacxx/include/cuda/__functional/proclaim_return_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ class __return_type_wrapper
__return_type_wrapper() = delete;

template <class _Fn, class = _CUDA_VSTD::enable_if_t<_CUDA_VSTD::is_same<_CUDA_VSTD::decay_t<_Fn>, _DecayFn>::value>>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 explicit __return_type_wrapper(_Fn&& __fn) noexcept
_LIBCUDACXX_HIDE_FROM_ABI constexpr explicit __return_type_wrapper(_Fn&& __fn) noexcept
: __fn_(_CUDA_VSTD::forward<_Fn>(__fn))
{}

template <class... _As>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 _Ret operator()(_As&&... __as) & noexcept
_LIBCUDACXX_HIDE_FROM_ABI constexpr _Ret operator()(_As&&... __as) & noexcept
{
#if !_CCCL_CUDA_COMPILER(NVCC) || defined(__CUDA_ARCH__)
static_assert(_CUDA_VSTD::is_same<_Ret, typename _CUDA_VSTD::__invoke_of<_DecayFn&, _As...>::type>::value,
Expand All @@ -58,7 +58,7 @@ class __return_type_wrapper
}

template <class... _As>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 _Ret operator()(_As&&... __as) && noexcept
_LIBCUDACXX_HIDE_FROM_ABI constexpr _Ret operator()(_As&&... __as) && noexcept
{
#if !_CCCL_CUDA_COMPILER(NVCC) || defined(__CUDA_ARCH__)
static_assert(_CUDA_VSTD::is_same<_Ret, typename _CUDA_VSTD::__invoke_of<_DecayFn, _As...>::type>::value,
Expand All @@ -69,7 +69,7 @@ class __return_type_wrapper
}

template <class... _As>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 _Ret operator()(_As&&... __as) const& noexcept
_LIBCUDACXX_HIDE_FROM_ABI constexpr _Ret operator()(_As&&... __as) const& noexcept
{
#if !_CCCL_CUDA_COMPILER(NVCC) || defined(__CUDA_ARCH__)
static_assert(_CUDA_VSTD::is_same<_Ret, typename _CUDA_VSTD::__invoke_of<const _DecayFn&, _As...>::type>::value,
Expand All @@ -80,7 +80,7 @@ class __return_type_wrapper
}

template <class... _As>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 _Ret operator()(_As&&... __as) const&& noexcept
_LIBCUDACXX_HIDE_FROM_ABI constexpr _Ret operator()(_As&&... __as) const&& noexcept
{
#if !_CCCL_CUDA_COMPILER(NVCC) || defined(__CUDA_ARCH__)
static_assert(_CUDA_VSTD::is_same<_Ret, typename _CUDA_VSTD::__invoke_of<const _DecayFn, _As...>::type>::value,
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/annotated_ptr
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public:
_CCCL_HIDE_FROM_ABI constexpr annotated_ptr() noexcept = default;
_CCCL_HIDE_FROM_ABI constexpr annotated_ptr(annotated_ptr const&) noexcept = default;
// No constexpr for c11 as the method can't be const
_CCCL_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 annotated_ptr& operator=(annotated_ptr const& other) noexcept = default;
_CCCL_HIDE_FROM_ABI constexpr annotated_ptr& operator=(annotated_ptr const& other) noexcept = default;

_CCCL_HOST_DEVICE explicit annotated_ptr(pointer __p)
: __repr(__p)
Expand Down
4 changes: 2 additions & 2 deletions libcudacxx/include/cuda/std/__algorithm/adjacent_find.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
_LIBCUDACXX_BEGIN_NAMESPACE_STD

template <class _ForwardIterator, class _BinaryPredicate>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 _ForwardIterator
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr _ForwardIterator
adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
{
if (__first != __last)
Expand All @@ -44,7 +44,7 @@ adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicat
}

template <class _ForwardIterator>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 _ForwardIterator
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr _ForwardIterator
adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
{
return _CUDA_VSTD::adjacent_find(__first, __last, __equal_to{});
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/std/__algorithm/all_of.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
_LIBCUDACXX_BEGIN_NAMESPACE_STD

template <class _InputIterator, class _Predicate>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool
all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
{
for (; __first != __last; ++__first)
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/std/__algorithm/any_of.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
_LIBCUDACXX_BEGIN_NAMESPACE_STD

template <class _InputIterator, class _Predicate>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool
any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
{
for (; __first != __last; ++__first)
Expand Down
4 changes: 2 additions & 2 deletions libcudacxx/include/cuda/std/__algorithm/binary_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
_LIBCUDACXX_BEGIN_NAMESPACE_STD

template <class _ForwardIterator, class _Tp, class _Compare>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp)
{
__first = _CUDA_VSTD::lower_bound<_ForwardIterator, _Tp, __comp_ref_type<_Compare>>(__first, __last, __value, __comp);
return __first != __last && !__comp(__value, *__first);
}

template <class _ForwardIterator, class _Tp>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
{
return _CUDA_VSTD::binary_search(__first, __last, __value, __less{});
Expand Down
5 changes: 2 additions & 3 deletions libcudacxx/include/cuda/std/__algorithm/clamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@
_LIBCUDACXX_BEGIN_NAMESPACE_STD

template <class _Tp, class _Compare>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 const _Tp&
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr const _Tp&
clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp)
{
_CCCL_ASSERT(!__comp(__hi, __lo), "Bad bounds passed to std::clamp");
return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v;
}

template <class _Tp>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 const _Tp&
clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr const _Tp& clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)
{
return _CUDA_VSTD::clamp(__v, __lo, __hi, __less{});
}
Expand Down
4 changes: 2 additions & 2 deletions libcudacxx/include/cuda/std/__algorithm/comp.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD
struct __equal_to
{
template <class _T1, class _T2>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool
operator()(const _T1& __lhs, const _T2& __rhs) const noexcept(noexcept(__lhs == __rhs))
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(const _T1& __lhs, const _T2& __rhs) const
noexcept(noexcept(__lhs == __rhs))
{
return __lhs == __rhs;
}
Expand Down
11 changes: 5 additions & 6 deletions libcudacxx/include/cuda/std/__algorithm/comp_ref_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ template <class _Compare>
struct __debug_less
{
_Compare& __comp_;
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 __debug_less(_Compare& __c)
_LIBCUDACXX_HIDE_FROM_ABI constexpr __debug_less(_Compare& __c)
: __comp_(__c)
{}

template <class _Tp, class _Up>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool operator()(const _Tp& __x, const _Up& __y)
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(const _Tp& __x, const _Up& __y)
{
bool __r = __comp_(__x, __y);
if (__r)
Expand All @@ -44,7 +44,7 @@ struct __debug_less
}

template <class _Tp, class _Up>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool operator()(_Tp& __x, _Up& __y)
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp& __x, _Up& __y)
{
bool __r = __comp_(__x, __y);
if (__r)
Expand All @@ -55,8 +55,7 @@ struct __debug_less
}

template <class _LHS, class _RHS>
_LIBCUDACXX_HIDE_FROM_ABI
_CCCL_CONSTEXPR_CXX14 decltype((void) declval<_Compare&>()(declval<_LHS&>(), declval<_RHS&>()))
_LIBCUDACXX_HIDE_FROM_ABI constexpr decltype((void) declval<_Compare&>()(declval<_LHS&>(), declval<_RHS&>()))
__do_compare_assert(int, _LHS& __l, _RHS& __r)
{
_CCCL_ASSERT(!__comp_(__l, __r), "Comparator does not induce a strict weak ordering");
Expand All @@ -65,7 +64,7 @@ struct __debug_less
}

template <class _LHS, class _RHS>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 void __do_compare_assert(long, _LHS&, _RHS&)
_LIBCUDACXX_HIDE_FROM_ABI constexpr void __do_compare_assert(long, _LHS&, _RHS&)
{}
};

Expand Down
13 changes: 6 additions & 7 deletions libcudacxx/include/cuda/std/__algorithm/copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
_LIBCUDACXX_BEGIN_NAMESPACE_STD

template <class _AlgPolicy, class _InputIterator, class _OutputIterator>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 pair<_InputIterator, _OutputIterator>
_LIBCUDACXX_HIDE_FROM_ABI constexpr pair<_InputIterator, _OutputIterator>
__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
for (; __first != __last; ++__first, (void) ++__result)
Expand All @@ -45,7 +45,7 @@ __copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
}

template <class _Tp, class _Up>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool __dispatch_memmove(_Up* __result, _Tp* __first, const size_t __n)
_LIBCUDACXX_HIDE_FROM_ABI constexpr bool __dispatch_memmove(_Up* __result, _Tp* __first, const size_t __n)
{
// This is a pessimisation, but there's no way to do the code path detection correctly before GCC 9.0.
// __builtin_memmove is also illegal in constexpr there, so... just always assume we are constant evaluated,
Expand Down Expand Up @@ -73,8 +73,7 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool __dispatch_memmove(_Up* __r
}

template <class _Tp, class _Up>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool
__constexpr_tail_overlap_fallback(_Tp* __first, _Up* __needle, _Tp* __last)
_LIBCUDACXX_HIDE_FROM_ABI constexpr bool __constexpr_tail_overlap_fallback(_Tp* __first, _Up* __needle, _Tp* __last)
{
while (__first != __last)
{
Expand All @@ -88,7 +87,7 @@ __constexpr_tail_overlap_fallback(_Tp* __first, _Up* __needle, _Tp* __last)
}

template <class _Tp, class _Up>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool __constexpr_tail_overlap(_Tp* __first, _Up* __needle, _Tp* __last)
_LIBCUDACXX_HIDE_FROM_ABI constexpr bool __constexpr_tail_overlap(_Tp* __first, _Up* __needle, _Tp* __last)
{
_LIBCUDACXX_UNUSED_VAR(__last);
#if defined(_CCCL_BUILTIN_CONSTANT_P)
Expand All @@ -105,7 +104,7 @@ template <class _AlgPolicy,
class _Up,
enable_if_t<_CCCL_TRAIT(is_same, remove_const_t<_Tp>, _Up), int> = 0,
enable_if_t<_CCCL_TRAIT(is_trivially_copyable, _Up), int> = 0>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 pair<_Tp*, _Up*> __copy(_Tp* __first, _Tp* __last, _Up* __result)
_LIBCUDACXX_HIDE_FROM_ABI constexpr pair<_Tp*, _Up*> __copy(_Tp* __first, _Tp* __last, _Up* __result)
{
const ptrdiff_t __n = __last - __first;
if (__n > 0)
Expand Down Expand Up @@ -134,7 +133,7 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 pair<_Tp*, _Up*> __copy(_Tp* __f
}

template <class _InputIterator, class _OutputIterator>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 _OutputIterator
_LIBCUDACXX_HIDE_FROM_ABI constexpr _OutputIterator
copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
return _CUDA_VSTD::__copy<_ClassicAlgPolicy>(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result))
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/std/__algorithm/copy_backward.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
_LIBCUDACXX_BEGIN_NAMESPACE_STD

template <class _BidirectionalIterator, class _OutputIterator>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 _OutputIterator
_LIBCUDACXX_HIDE_FROM_ABI constexpr _OutputIterator
__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
{
while (__first != __last)
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/std/__algorithm/copy_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
_LIBCUDACXX_BEGIN_NAMESPACE_STD

template <class _InputIterator, class _OutputIterator, class _Predicate>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 _OutputIterator
_LIBCUDACXX_HIDE_FROM_ABI constexpr _OutputIterator
copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred)
{
for (; __first != __last; ++__first)
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/std/__algorithm/copy_n.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ template <class _InputIterator,
class _Size,
class _OutputIterator,
enable_if_t<__is_cpp17_random_access_iterator<_InputIterator>::value, int> = 0>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 _OutputIterator
_LIBCUDACXX_HIDE_FROM_ABI constexpr _OutputIterator
copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
{
using _IntegralSize = decltype(__convert_to_integral(__orig_n));
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/std/__algorithm/count.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
_LIBCUDACXX_BEGIN_NAMESPACE_STD

template <class _InputIterator, class _Tp>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 __iter_diff_t<_InputIterator>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr __iter_diff_t<_InputIterator>
count(_InputIterator __first, _InputIterator __last, const _Tp& __value_)
{
__iter_diff_t<_InputIterator> __r{0};
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/std/__algorithm/count_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
_LIBCUDACXX_BEGIN_NAMESPACE_STD

template <class _InputIterator, class _Predicate>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 __iter_diff_t<_InputIterator>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr __iter_diff_t<_InputIterator>
count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
{
__iter_diff_t<_InputIterator> __r{0};
Expand Down
12 changes: 6 additions & 6 deletions libcudacxx/include/cuda/std/__algorithm/equal.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD

_CCCL_EXEC_CHECK_DISABLE
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred)
{
for (; __first1 != __last1; ++__first1, (void) ++__first2)
Expand All @@ -43,15 +43,15 @@ equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first
}

template <class _InputIterator1, class _InputIterator2>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2)
{
return _CUDA_VSTD::equal(__first1, __last1, __first2, __equal_to{});
}

_CCCL_EXEC_CHECK_DISABLE
template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool __equal(
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __equal(
_InputIterator1 __first1,
_InputIterator1 __last1,
_InputIterator2 __first2,
Expand All @@ -71,7 +71,7 @@ _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool __equal(
}

template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool __equal(
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __equal(
_RandomAccessIterator1 __first1,
_RandomAccessIterator1 __last1,
_RandomAccessIterator2 __first2,
Expand All @@ -89,7 +89,7 @@ _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool __equal(
}

template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool
equal(_InputIterator1 __first1,
_InputIterator1 __last1,
_InputIterator2 __first2,
Expand All @@ -107,7 +107,7 @@ equal(_InputIterator1 __first1,
}

template <class _InputIterator1, class _InputIterator2>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2)
{
return _CUDA_VSTD::__equal(
Expand Down
6 changes: 3 additions & 3 deletions libcudacxx/include/cuda/std/__algorithm/equal_range.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
_LIBCUDACXX_BEGIN_NAMESPACE_STD

template <class _AlgPolicy, class _Compare, class _Iter, class _Sent, class _Tp, class _Proj>
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 pair<_Iter, _Iter>
_LIBCUDACXX_HIDE_FROM_ABI constexpr pair<_Iter, _Iter>
__equal_range(_Iter __first, _Sent __last, const _Tp& __value, _Compare&& __comp, _Proj&& __proj)
{
auto __len = _IterOps<_AlgPolicy>::distance(__first, __last);
Expand Down Expand Up @@ -70,7 +70,7 @@ __equal_range(_Iter __first, _Sent __last, const _Tp& __value, _Compare&& __comp
}

template <class _ForwardIterator, class _Tp, class _Compare>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 pair<_ForwardIterator, _ForwardIterator>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr pair<_ForwardIterator, _ForwardIterator>
equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp)
{
static_assert(__is_callable<_Compare, decltype(*__first), const _Tp&>::value, "The comparator has to be callable");
Expand All @@ -84,7 +84,7 @@ equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __valu
}

template <class _ForwardIterator, class _Tp>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 pair<_ForwardIterator, _ForwardIterator>
_CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr pair<_ForwardIterator, _ForwardIterator>
equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
{
return _CUDA_VSTD::equal_range(_CUDA_VSTD::move(__first), _CUDA_VSTD::move(__last), __value, __less{});
Expand Down
Loading

0 comments on commit c27d887

Please sign in to comment.