Skip to content

Commit 4e02198

Browse files
Fix ambiguity in is_sorted and is_partitioned overloads and update traits
1 parent b1223a9 commit 4e02198

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

libs/core/algorithms/include/hpx/parallel/algorithms/is_partitioned.hpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) 2020 ETH Zurich
22
// Copyright (c) 2015 Daniel Bourgeois
3-
// Copyright (c) 2017-2025 Hartmut Kaiser
3+
// Copyright (c) 2017-2026 Hartmut Kaiser
44
//
55
// SPDX-License-Identifier: BSL-1.0
66
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -260,7 +260,10 @@ namespace hpx {
260260
template <typename FwdIter, typename Pred>
261261
// clang-format off
262262
requires (
263-
std::forward_iterator<FwdIter>
263+
std::forward_iterator<FwdIter> &&
264+
hpx::is_invocable_v<Pred,
265+
hpx::traits::iter_value_t<FwdIter>
266+
>
264267
)
265268
// clang-format on
266269
friend bool tag_fallback_invoke(
@@ -275,7 +278,10 @@ namespace hpx {
275278
// clang-format off
276279
requires (
277280
hpx::is_execution_policy_v<ExPolicy> &&
278-
std::forward_iterator<FwdIter>
281+
std::forward_iterator<FwdIter> &&
282+
hpx::is_invocable_v<Pred,
283+
hpx::traits::iter_value_t<FwdIter>
284+
>
279285
)
280286
// clang-format on
281287
friend decltype(auto) tag_fallback_invoke(hpx::is_partitioned_t,
@@ -291,7 +297,11 @@ namespace hpx {
291297
// clang-format off
292298
requires (
293299
std::forward_iterator<FwdIter> &&
294-
hpx::parallel::traits::is_projected_v<Proj, FwdIter>
300+
hpx::parallel::traits::is_projected_v<Proj, FwdIter> &&
301+
hpx::is_invocable_v<Pred,
302+
hpx::util::invoke_result_t<Proj,
303+
hpx::traits::iter_value_t<FwdIter>>
304+
>
295305
)
296306
// clang-format on
297307
friend bool tag_fallback_invoke(hpx::is_partitioned_t, FwdIter first,
@@ -308,7 +318,11 @@ namespace hpx {
308318
requires (
309319
hpx::is_execution_policy_v<ExPolicy> &&
310320
std::forward_iterator<FwdIter> &&
311-
hpx::parallel::traits::is_projected_v<Proj, FwdIter>
321+
hpx::parallel::traits::is_projected_v<Proj, FwdIter> &&
322+
hpx::is_invocable_v<Pred,
323+
hpx::util::invoke_result_t<Proj,
324+
hpx::traits::iter_value_t<FwdIter>>
325+
>
312326
)
313327
// clang-format on
314328
friend decltype(auto) tag_fallback_invoke(hpx::is_partitioned_t,

libs/core/algorithms/include/hpx/parallel/container_algorithms/is_partitioned.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) 2020 ETH Zurich
22
// Copyright (c) 2015 Daniel Bourgeois
3-
// Copyright (c) 2017-2023 Hartmut Kaiser
3+
// Copyright (c) 2017-2026 Hartmut Kaiser
44
//
55
// SPDX-License-Identifier: BSL-1.0
66
// Distributed under the Boost Software License, Version 1.0. (See accompanying

libs/core/algorithms/include/hpx/parallel/container_algorithms/is_sorted.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright (c) 2020 ETH Zurich
2+
// Copyright (c) 2017-2026 Hartmut Kaiser
23
//
34
// SPDX-License-Identifier: BSL-1.0
45
// Distributed under the Boost Software License, Version 1.0. (See accompanying

0 commit comments

Comments
 (0)