[PATCH] D56139: [pstl] Fix compile errors when PARALLEL_POLICIES is disabled
Alexey Kukanov via Phabricator
reviews at reviews.llvm.org
Thu Jan 10 02:44:17 PST 2019
akukanov 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([&]() {
----------------
MikeDvorskiy wrote:
> 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.
Mikhail, I think that use of `enable_if_execution_policy` is inconsistent if only applied to "parallel" overloads, and less clear comparing to the macro.
If the SFINAE way is preferred, we should make it differently, e.g. introduce `enable_if_parallel`/`enable_if_not_parallel` and use those instead of `is_parallel` function parameter which becomes redundant.
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