Skip to content

Commit

Permalink
added check for unseq ExPolicy as it was added only in CXX20
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan511 committed Mar 29, 2023
1 parent 8953308 commit 1234486
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,19 @@ namespace hpx::parallel::detail {
constexpr Iter sequential_generate_n_helper(
Iter first, std::size_t count, F&& f, /*is unsequenced*/ std::true_type)
{
#ifdef HPX_WITH_CXX20_STD_EXECUTION_POLICES
return std::generate_n(std::execution::unseq, first, count, f);
#else
// do not use std::execution::seq, execution policies were added only in CXX17
return std::generate_n(first, count, f);
#endif
}

template <typename Iter, typename F>
constexpr Iter sequential_generate_n_helper(Iter first, std::size_t count,
F&& f, /*is unsequenced*/ std::false_type)
{
return std::generate_n(std::execution::seq, first, count, f);
return std::generate_n(first, count, f);
}

struct sequential_generate_n_t
Expand Down

0 comments on commit 1234486

Please sign in to comment.