if (__last1 - __first1 != __last2 - __first2)
return false;
- return __unseq_backend::__simd_first(__first1, __last1 - __first1, __first2,
- __internal::__not_pred<_BinaryPredicate>(__p))
- .first == __last1;
+ return __unseq_backend::__simd_first(__first1, __last1 - __first1, __first2, std::not_fn(__p)).first == __last1;
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
__brick_equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2,
_BinaryPredicate __p, /* is_vector = */ std::true_type) noexcept
{
- return __unseq_backend::__simd_first(__first1, __last1 - __first1, __first2, __not_pred<_BinaryPredicate>(__p))
- .first == __last1;
+ return __unseq_backend::__simd_first(__first1, __last1 - __first1, __first2, std::not_fn(__p)).first == __last1;
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate,
// check that all of elements in [first+1, first+count) equal to value
if (__first != __last && (static_cast<_Size>(__global_last - __first) >= __count) &&
- !__internal::__brick_any_of(__first + 1, __first + __count,
- __not_pred<decltype(__unary_pred)>(__unary_pred), __is_vector))
+ !__internal::__brick_any_of(__first + 1, __first + __count, std::not_fn(__unary_pred), __is_vector))
{
return __first;
}
{
// find first element that don't satisfy pred
_ForwardIterator __x =
- __internal::__brick_find_if(__i + 1, __j, __not_pred<_UnaryPredicate>(__pred), __is_vector);
+ __internal::__brick_find_if(__i + 1, __j, std::not_fn(__pred), __is_vector);
if (__x != __j)
{
// find first element after "x" that satisfy pred
std::forward<_ExecutionPolicy>(__exec), __first + 1, __last, std::make_pair(__first, __first),
[=](_ForwardIterator __begin, _ForwardIterator __end, _Result __init) -> _Result {
const _Result __subresult = __internal::__brick_minmax_element(__begin, __end, __comp, __is_vector);
- return std::make_pair(__internal::__cmp_iterators_by_values(__subresult.first, __init.first, __comp),
- __internal::__cmp_iterators_by_values(__init.second, __subresult.second,
- __not_pred<_Compare>(__comp)));
+ return std::make_pair(
+ __internal::__cmp_iterators_by_values(__subresult.first, __init.first, __comp),
+ __internal::__cmp_iterators_by_values(__init.second, __subresult.second, std::not_fn(__comp)));
},
[=](_Result __p1, _Result __p2) -> _Result {
return std::make_pair(
__internal::__cmp_iterators_by_values(__p1.first, __p2.first, __comp),
- __internal::__cmp_iterators_by_values(__p2.second, __p1.second, __not_pred<_Compare>(__comp)));
+ __internal::__cmp_iterators_by_values(__p2.second, __p1.second, std::not_fn(__comp)));
});
});
}
_ForwardIterator2 __last2, _Predicate __pred, /* __is_vector = */ std::true_type) noexcept
{
auto __n = std::min(__last1 - __first1, __last2 - __first2);
- return __unseq_backend::__simd_first(__first1, __n, __first2, __not_pred<_Predicate>(__pred));
+ return __unseq_backend::__simd_first(__first1, __n, __first2, std::not_fn(__pred));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate, class _IsVector>
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
all_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred)
{
- return !std::any_of(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- __pstl::__internal::__not_pred<_Pred>(__pred));
+ return !std::any_of(std::forward<_ExecutionPolicy>(__exec), __first, __last, std::not_fn(__pred));
}
// [alg.none_of]
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
find_if_not(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
{
- return std::find_if(std::forward<_ExecutionPolicy>(__exec), __first, __last,
- __pstl::__internal::__not_pred<_Predicate>(__pred));
+ return std::find_if(std::forward<_ExecutionPolicy>(__exec), __first, __last, std::not_fn(__pred));
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp>
_ForwardIterator2 __s_last)
{
return std::find_end(std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first, __s_last,
- __pstl::__internal::__pstl_equal());
+ std::equal_to<>());
}
// [alg.find_first_of]
_ForwardIterator2 __s_first, _ForwardIterator2 __s_last)
{
return std::find_first_of(std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first, __s_last,
- __pstl::__internal::__pstl_equal());
+ std::equal_to<>());
}
// [alg.adjacent_find]
search(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
_ForwardIterator2 __s_last)
{
- return std::search(std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first, __s_last,
- __pstl::__internal::__pstl_equal());
+ return std::search(std::forward<_ExecutionPolicy>(__exec), __first, __last, __s_first, __s_last, std::equal_to<>());
}
template <class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
remove_copy_if(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last,
_ForwardIterator2 __result, _Predicate __pred)
{
- return std::copy_if(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result,
- __pstl::__internal::__not_pred<_Predicate>(__pred));
+ return std::copy_if(std::forward<_ExecutionPolicy>(__exec), __first, __last, __result, std::not_fn(__pred));
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator>
unique(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last)
{
- return std::unique(std::forward<_ExecutionPolicy>(__exec), __first, __last, __pstl::__internal::__pstl_equal());
+ return std::unique(std::forward<_ExecutionPolicy>(__exec), __first, __last, std::equal_to<>());
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
unique_copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result)
{
- return std::unique_copy(__exec, __first, __last, __result, __pstl::__internal::__pstl_equal());
+ return std::unique_copy(__exec, __first, __last, __result, std::equal_to<>());
}
// [alg.reverse]
_ForwardIterator2 __last2)
{
return std::mismatch(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2,
- __pstl::__internal::__pstl_equal());
+ std::equal_to<>());
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool>
equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2)
{
- return std::equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2,
- __pstl::__internal::__pstl_equal());
+ return std::equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, std::equal_to<>());
}
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
equal(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2)
{
- return equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2,
- __pstl::__internal::__pstl_equal());
+ return equal(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, std::equal_to<>());
}
// [alg.move]
_RandomAccessIterator __d_first, _RandomAccessIterator __d_last)
{
return std::partial_sort_copy(std::forward<_ExecutionPolicy>(__exec), __first, __last, __d_first, __d_last,
- __pstl::__internal::__pstl_less());
+ std::less<>());
}
// [is.sorted]
_ForwardIterator2 __last2, _ForwardIterator __d_first)
{
return std::merge(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __d_first,
- __pstl::__internal::__pstl_less());
+ std::less<>());
}
template <class _ExecutionPolicy, class _BidirectionalIterator, class _Compare>
includes(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
_ForwardIterator2 __last2)
{
- return std::includes(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2,
- __pstl::__internal::__pstl_less());
+ return std::includes(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, std::less<>());
}
// [set.union]
_ForwardIterator2 __last2, _ForwardIterator __result)
{
return std::set_union(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result,
- __pstl::__internal::__pstl_less());
+ std::less<>());
}
// [set.intersection]
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result)
{
return std::set_intersection(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result,
- __pstl::__internal::__pstl_less());
+ std::less<>());
}
// [set.difference]
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result)
{
return std::set_difference(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2, __result,
- __pstl::__internal::__pstl_less());
+ std::less<>());
}
// [set.symmetric.difference]
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _ForwardIterator __result)
{
return std::set_symmetric_difference(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2,
- __result, __pstl::__internal::__pstl_less());
+ __result, std::less<>());
}
// [is.heap]
_ForwardIterator2 __first2, _ForwardIterator2 __last2)
{
return std::lexicographical_compare(std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __last2,
- __pstl::__internal::__pstl_less());
+ std::less<>());
}
} // namespace std