Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename itr to correct type (reduce) #5954

Merged
merged 1 commit into from
Jul 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions libs/core/algorithms/include/hpx/parallel/algorithms/reduce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,16 +368,16 @@ namespace hpx {
}

// clang-format off
template <typename FwdIter, typename F,
typename T = typename std::iterator_traits<FwdIter>::value_type,
template <typename InIter, typename F,
typename T = typename std::iterator_traits<InIter>::value_type,
HPX_CONCEPT_REQUIRES_(
hpx::traits::is_iterator<FwdIter>::value
hpx::traits::is_iterator<InIter>::value
)>
// clang-format on
friend T tag_fallback_invoke(
hpx::reduce_t, FwdIter first, FwdIter last, T init, F&& f)
hpx::reduce_t, InIter first, InIter last, T init, F&& f)
{
static_assert(hpx::traits::is_input_iterator<FwdIter>::value,
static_assert(hpx::traits::is_input_iterator<InIter>::value,
"Requires at least input iterator.");

return hpx::parallel::v1::detail::reduce<T>().call(
Expand All @@ -386,16 +386,16 @@ namespace hpx {
}

// clang-format off
template <typename FwdIter,
typename T = typename std::iterator_traits<FwdIter>::value_type,
template <typename InIter,
typename T = typename std::iterator_traits<InIter>::value_type,
HPX_CONCEPT_REQUIRES_(
hpx::traits::is_iterator<FwdIter>::value
hpx::traits::is_iterator<InIter>::value
)>
// clang-format on
friend T tag_fallback_invoke(
hpx::reduce_t, FwdIter first, FwdIter last, T init)
hpx::reduce_t, InIter first, InIter last, T init)
{
static_assert(hpx::traits::is_input_iterator<FwdIter>::value,
static_assert(hpx::traits::is_input_iterator<InIter>::value,
"Requires at least input iterator.");

return hpx::parallel::v1::detail::reduce<T>().call(
Expand All @@ -404,19 +404,19 @@ namespace hpx {
}

// clang-format off
template <typename FwdIter,
template <typename InIter,
HPX_CONCEPT_REQUIRES_(
hpx::traits::is_iterator<FwdIter>::value
hpx::traits::is_iterator<InIter>::value
)>
// clang-format on
friend typename std::iterator_traits<FwdIter>::value_type
tag_fallback_invoke(hpx::reduce_t, FwdIter first, FwdIter last)
friend typename std::iterator_traits<InIter>::value_type
tag_fallback_invoke(hpx::reduce_t, InIter first, InIter last)
{
static_assert(hpx::traits::is_input_iterator<FwdIter>::value,
static_assert(hpx::traits::is_input_iterator<InIter>::value,
"Requires at least input iterator.");

using value_type =
typename std::iterator_traits<FwdIter>::value_type;
typename std::iterator_traits<InIter>::value_type;

return hpx::parallel::v1::detail::reduce<value_type>().call(
hpx::execution::seq, first, last, value_type{}, std::plus<>());
Expand Down