Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
libcxx/include/pstl/internal/glue_algorithm_impl.h
Show All 19 Lines | |||||
#include "numeric_fwd.h" /* count and count_if use __pattern_transform_reduce */ | #include "numeric_fwd.h" /* count and count_if use __pattern_transform_reduce */ | ||||
#include "execution_impl.h" | #include "execution_impl.h" | ||||
_PSTL_HIDE_FROM_ABI_PUSH | _PSTL_HIDE_FROM_ABI_PUSH | ||||
namespace std { | namespace std { | ||||
// [alg.any_of] | |||||
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate> | |||||
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> | |||||
any_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { | |||||
auto __dispatch_tag = __pstl::__internal::__select_backend(__exec, __first); | |||||
return __pstl::__internal::__pattern_any_of( | |||||
__dispatch_tag, std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred); | |||||
} | |||||
// [alg.all_of] | |||||
template <class _ExecutionPolicy, class _ForwardIterator, class _Pred> | |||||
__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, std::not_fn(__pred)); | |||||
} | |||||
// [alg.none_of] | |||||
template <class _ExecutionPolicy, class _ForwardIterator, class _Predicate> | |||||
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, bool> | |||||
none_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { | |||||
return !std::any_of(std::forward<_ExecutionPolicy>(__exec), __first, __last, __pred); | |||||
} | |||||
// [alg.foreach] | // [alg.foreach] | ||||
template <class _ExecutionPolicy, class _ForwardIterator, class _Function> | template <class _ExecutionPolicy, class _ForwardIterator, class _Function> | ||||
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> | __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> | ||||
for_each(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Function __f) { | for_each(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Function __f) { | ||||
auto __dispatch_tag = __pstl::__internal::__select_backend(__exec, __first); | auto __dispatch_tag = __pstl::__internal::__select_backend(__exec, __first); | ||||
__pstl::__internal::__pattern_walk1(__dispatch_tag, std::forward<_ExecutionPolicy>(__exec), __first, __last, __f); | __pstl::__internal::__pattern_walk1(__dispatch_tag, std::forward<_ExecutionPolicy>(__exec), __first, __last, __f); | ||||
▲ Show 20 Lines • Show All 1,204 Lines • Show Last 20 Lines |