[PATCH] D56139: [pstl] Fix compile errors when PARALLEL_POLICIES is disabled
Mikhail Dvorskiy via Phabricator
reviews at reviews.llvm.org
Thu Jan 10 02:00:31 PST 2019
MikeDvorskiy added inline comments.
================
Comment at: include/pstl/internal/algorithm_impl.h:62-75
+#if __PSTL_USE_PAR_POLICIES
template <class _ExecutionPolicy, class _ForwardIterator, class _Pred, class _IsVector>
bool
pattern_any_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred,
_IsVector __is_vector, /*parallel=*/std::true_type)
{
return internal::except_handler([&]() {
----------------
What if I suggest excluding the overloaded parallel pattern (here and everywhere) by SFINAE approach, like this:
__pstl::internal::enable_if_execution_policy<_ExecutionPolicy, bool>
pattern_any_of(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Pred __pred,.....
The macro __PSTL_USE_PAR_POLICIES controls parallel policies definitions and it should be enough.
Repository:
rPSTL pstl
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56139/new/
https://reviews.llvm.org/D56139
More information about the libcxx-commits
mailing list