Skip to content

Commit efd8f79

Browse files
Robust type deduction and standardize CI compliance
1 parent 9796526 commit efd8f79

3 files changed

Lines changed: 21 additions & 14 deletions

File tree

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

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// Copyright (c) 2014-2025 Hartmut Kaiser
1+
// Copyright (c) 2014-2026 Hartmut Kaiser
2+
// Copyright (c) 2024-2026 STE||AR-Group
23
//
34
// SPDX-License-Identifier: BSL-1.0
45
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -443,10 +444,11 @@ namespace hpx::parallel {
443444

444445
auto smallest = *it;
445446

446-
using element_type = hpx::traits::proxy_value_t<
447-
std::decay_t<hpx::util::invoke_result_t<Proj,
448-
hpx::traits::iter_reference_t<typename std::
449-
iterator_traits<FwdIter>::value_type>>>>;
447+
using source_iter_type =
448+
typename std::iterator_traits<FwdIter>::value_type;
449+
using element_type = hpx::traits::proxy_value_t<std::decay_t<
450+
hpx::util::invoke_result_t<Proj,
451+
hpx::traits::iter_reference_t<source_iter_type>>>>;
450452

451453
element_type value = HPX_INVOKE(proj, *smallest);
452454
util::loop_n<std::decay_t<ExPolicy>>(
@@ -598,10 +600,11 @@ namespace hpx::parallel {
598600

599601
auto largest = *it;
600602

601-
using element_type = hpx::traits::proxy_value_t<
602-
std::decay_t<hpx::util::invoke_result_t<Proj,
603-
hpx::traits::iter_reference_t<typename std::
604-
iterator_traits<FwdIter>::value_type>>>>;
603+
using source_iter_type =
604+
typename std::iterator_traits<FwdIter>::value_type;
605+
using element_type = hpx::traits::proxy_value_t<std::decay_t<
606+
hpx::util::invoke_result_t<Proj,
607+
hpx::traits::iter_reference_t<source_iter_type>>>>;
605608

606609
element_type value = HPX_INVOKE(proj, *largest);
607610
util::loop_n<std::decay_t<ExPolicy>>(
@@ -760,9 +763,13 @@ namespace hpx::parallel {
760763

761764
auto result = *it;
762765

763-
using element_type = hpx::traits::proxy_value_t<
764-
std::decay_t<hpx::util::invoke_result_t<Proj,
765-
hpx::traits::iter_reference_t<Iter>>>>;
766+
using source_iter_type = decltype(
767+
std::declval<typename std::iterator_traits<PairIter>::
768+
value_type>()
769+
.min);
770+
using element_type = hpx::traits::proxy_value_t<std::decay_t<
771+
hpx::util::invoke_result_t<Proj,
772+
hpx::traits::iter_reference_t<source_iter_type>>>>;
766773

767774
element_type min_value = HPX_INVOKE(proj, *result.min);
768775
element_type max_value = HPX_INVOKE(proj, *result.max);

libs/core/algorithms/tests/unit/algorithms/minmax_element_parallel_projection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 STE||AR-Group
1+
// Copyright (c) 2024-2026 STE||AR-Group
22
//
33
// SPDX-License-Identifier: BSL-1.0
44
// Distributed under the Boost Software License, Version 1.0. (See accompanying

libs/core/algorithms/tests/unit/algorithms/minmax_element_projection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2026 Hartmut Kaiser
1+
// Copyright (c) 2024-2026 STE||AR-Group
22
//
33
// SPDX-License-Identifier: BSL-1.0
44
// Distributed under the Boost Software License, Version 1.0. (See accompanying

0 commit comments

Comments
 (0)