Skip to content

Commit

Permalink
Merge #388
Browse files Browse the repository at this point in the history
388: Replace typename std::decay by std::decay_t r=aurianer a=aurianer

Help with the cleanup

Co-authored-by: Auriane R <aurianer@cscs.ch>
  • Loading branch information
bors[bot] and aurianer authored Aug 22, 2022
2 parents 242c67d + 14a23fb commit 2d7ba4e
Show file tree
Hide file tree
Showing 64 changed files with 248 additions and 291 deletions.
11 changes: 5 additions & 6 deletions examples/quickstart/disable_thread_stealing_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,36 +78,35 @@ namespace pika { namespace parallel { namespace execution {
template <typename BaseExecutor>
struct is_one_way_executor<
executor_example::disable_thread_stealing_executor<BaseExecutor>>
: is_one_way_executor<typename std::decay<BaseExecutor>::type>
: is_one_way_executor<std::decay_t<BaseExecutor>>
{
};

template <typename BaseExecutor>
struct is_never_blocking_one_way_executor<
executor_example::disable_thread_stealing_executor<BaseExecutor>>
: is_never_blocking_one_way_executor<
typename std::decay<BaseExecutor>::type>
: is_never_blocking_one_way_executor<std::decay_t<BaseExecutor>>
{
};

template <typename BaseExecutor>
struct is_two_way_executor<
executor_example::disable_thread_stealing_executor<BaseExecutor>>
: is_two_way_executor<typename std::decay<BaseExecutor>::type>
: is_two_way_executor<std::decay_t<BaseExecutor>>
{
};

template <typename BaseExecutor>
struct is_bulk_one_way_executor<
executor_example::disable_thread_stealing_executor<BaseExecutor>>
: is_bulk_one_way_executor<typename std::decay<BaseExecutor>::type>
: is_bulk_one_way_executor<std::decay_t<BaseExecutor>>
{
};

template <typename BaseExecutor>
struct is_bulk_two_way_executor<
executor_example::disable_thread_stealing_executor<BaseExecutor>>
: is_bulk_two_way_executor<typename std::decay<BaseExecutor>::type>
: is_bulk_two_way_executor<std::decay_t<BaseExecutor>>
{
};
}}} // namespace pika::parallel::execution
Expand Down
11 changes: 5 additions & 6 deletions examples/quickstart/executor_with_thread_hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,36 +177,35 @@ namespace pika { namespace parallel { namespace execution {
template <typename BaseExecutor>
struct is_one_way_executor<
executor_example::executor_with_thread_hooks<BaseExecutor>>
: is_one_way_executor<typename std::decay<BaseExecutor>::type>
: is_one_way_executor<std::decay_t<BaseExecutor>>
{
};

template <typename BaseExecutor>
struct is_never_blocking_one_way_executor<
executor_example::executor_with_thread_hooks<BaseExecutor>>
: is_never_blocking_one_way_executor<
typename std::decay<BaseExecutor>::type>
: is_never_blocking_one_way_executor<std::decay_t<BaseExecutor>>
{
};

template <typename BaseExecutor>
struct is_two_way_executor<
executor_example::executor_with_thread_hooks<BaseExecutor>>
: is_two_way_executor<typename std::decay<BaseExecutor>::type>
: is_two_way_executor<std::decay_t<BaseExecutor>>
{
};

template <typename BaseExecutor>
struct is_bulk_one_way_executor<
executor_example::executor_with_thread_hooks<BaseExecutor>>
: is_bulk_one_way_executor<typename std::decay<BaseExecutor>::type>
: is_bulk_one_way_executor<std::decay_t<BaseExecutor>>
{
};

template <typename BaseExecutor>
struct is_bulk_two_way_executor<
executor_example::executor_with_thread_hooks<BaseExecutor>>
: is_bulk_two_way_executor<typename std::decay<BaseExecutor>::type>
: is_bulk_two_way_executor<std::decay_t<BaseExecutor>>
{
};
}}} // namespace pika::parallel::execution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace pika { namespace traits {
template <typename T, typename Enable = void>
struct projected_iterator
{
using type = typename std::decay<T>::type;
using type = std::decay_t<T>;
};

template <typename Iterator>
Expand Down Expand Up @@ -87,8 +87,7 @@ namespace pika { namespace parallel { namespace traits {

template <typename F, typename Iter, typename Enable = void>
struct projected_result_of
: detail::projected_result_of<typename std::decay<F>::type,
typename std::decay<Iter>::type>
: detail::projected_result_of<std::decay_t<F>, std::decay_t<Iter>>
{
};

Expand Down Expand Up @@ -135,7 +134,7 @@ namespace pika { namespace parallel { namespace traits {

template <typename F, typename Iter, typename Enable = void>
struct is_projected
: detail::is_projected<typename std::decay<F>::type,
: detail::is_projected<std::decay_t<F>,
typename pika::traits::projected_iterator<Iter>::type>
{
};
Expand All @@ -150,7 +149,7 @@ namespace pika { namespace parallel { namespace traits {
template <typename Proj, typename Iter>
struct projected
{
using projector_type = typename std::decay<Proj>::type;
using projector_type = std::decay_t<Proj>;
using iterator_type =
typename pika::traits::projected_iterator<Iter>::type;
};
Expand Down Expand Up @@ -218,9 +217,8 @@ namespace pika { namespace parallel { namespace traits {

template <typename ExPolicy, typename F, typename... Projected>
struct is_indirect_callable
: detail::is_indirect_callable<typename std::decay<ExPolicy>::type,
typename std::decay<F>::type,
pika::util::pack<typename std::decay<Projected>::type...>>
: detail::is_indirect_callable<std::decay_t<ExPolicy>, std::decay_t<F>,
pika::util::pack<std::decay_t<Projected>...>>
{
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace pika { namespace parallel { namespace traits {
template <typename Proj, typename Rng>
struct projected_range_result_of<Proj, Rng,
typename std::enable_if<pika::traits::is_range<Rng>::value>::type>
: detail::projected_result_of<typename std::decay<Proj>::type,
: detail::projected_result_of<std::decay_t<Proj>,
typename pika::traits::range_iterator<Rng>::type>
{
};
Expand All @@ -39,7 +39,7 @@ namespace pika { namespace parallel { namespace traits {
template <typename Proj, typename Rng>
struct is_projected_range<Proj, Rng,
typename std::enable_if<pika::traits::is_range<Rng>::value>::type>
: detail::is_projected<typename std::decay<Proj>::type,
: detail::is_projected<std::decay_t<Proj>,
typename pika::traits::range_iterator<Rng>::type>
{
};
Expand All @@ -58,7 +58,7 @@ namespace pika { namespace parallel { namespace traits {
struct projected_range<Proj, Rng,
typename std::enable_if<pika::traits::is_range<Rng>::value>::type>
{
using projector_type = typename std::decay<Proj>::type;
using projector_type = std::decay_t<Proj>;
using iterator_type = typename pika::traits::range_iterator<Rng>::type;
};
}}} // namespace pika::parallel::traits
11 changes: 5 additions & 6 deletions libs/pika/algorithms/include/pika/parallel/algorithms/count.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,16 @@ namespace pika { namespace parallel { inline namespace v1 {
template <typename ExPolicy, typename Op, typename Proj>
struct count_iteration
{
using execution_policy_type = typename std::decay<ExPolicy>::type;
using proj_type = typename std::decay<Proj>::type;
using op_type = typename std::decay<Op>::type;
using execution_policy_type = std::decay_t<ExPolicy>;
using proj_type = std::decay_t<Proj>;
using op_type = std::decay_t<Op>;

op_type op_;
proj_type proj_;

template <typename Op_, typename Proj_,
typename U = typename std::enable_if<
!std::is_same<typename std::decay<Op_>::type,
count_iteration>::value>::type>
typename U = typename std::enable_if<!std::is_same<
std::decay_t<Op_>, count_iteration>::value>::type>
PIKA_HOST_DEVICE count_iteration(Op_&& op, Proj_&& proj)
: op_(PIKA_FORWARD(Op_, op))
, proj_(PIKA_FORWARD(Proj_, proj))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ namespace pika { namespace parallel { inline namespace v1 { namespace detail {
Iter parallel_stable_sort(Exec&& exec, Iter first, Sent last,
std::size_t cores, std::size_t chunk_size, Compare&& comp)
{
using parallel_stable_sort_helper_t = parallel_stable_sort_helper<Iter,
Sent, typename std::decay<Compare>::type>;
using parallel_stable_sort_helper_t =
parallel_stable_sort_helper<Iter, Sent, std::decay_t<Compare>>;

parallel_stable_sort_helper_t sorter(
first, last, PIKA_FORWARD(Compare, comp));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ namespace pika { namespace parallel { inline namespace v1 { namespace detail {
std::size_t chunk_size)
{
using sample_sort_helper_t =
sample_sort_helper<Iter, Sent, typename std::decay<Compare>::type>;
sample_sort_helper<Iter, Sent, std::decay_t<Compare>>;

sample_sort_helper_t sorter(PIKA_FORWARD(Compare, comp), num_threads);
sorter(PIKA_FORWARD(Exec, exec), first, last, paux, naux, chunk_size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,23 +225,23 @@ namespace pika { namespace parallel { inline namespace v1 { namespace detail {
template <typename Iter, typename Sent, typename Compare>
void spin_sort(Iter first, Sent last, Compare&& comp)
{
spin_sort_helper<Iter, Sent, typename std::decay<Compare>::type> sorter(
spin_sort_helper<Iter, Sent, std::decay_t<Compare>> sorter(
first, last, PIKA_FORWARD(Compare, comp));
}

template <typename Iter, typename Sent, typename Compare>
void spin_sort(Iter first, Sent last, Compare&& comp,
util::range<typename std::iterator_traits<Iter>::value_type*> range_aux)
{
spin_sort_helper<Iter, Sent, typename std::decay<Compare>::type> sorter(
spin_sort_helper<Iter, Sent, std::decay_t<Compare>> sorter(
first, last, PIKA_FORWARD(Compare, comp), range_aux);
}

template <typename Iter, typename Sent, typename Compare>
void spin_sort(Iter first, Sent last, Compare comp,
typename std::iterator_traits<Iter>::value_type* paux, std::size_t naux)
{
spin_sort_helper<Iter, Sent, typename std::decay<Compare>::type> sorter(
spin_sort_helper<Iter, Sent, std::decay_t<Compare>> sorter(
first, last, PIKA_FORWARD(Compare, comp), paux, naux);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ namespace pika { namespace parallel { inline namespace v1 {
template <typename T>
struct fill_iteration
{
typename std::decay<T>::type val_;
std::decay_t<T> val_;

template <typename U>
PIKA_HOST_DEVICE typename std::enable_if<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace pika { namespace parallel { inline namespace v2 {
constexpr void exit_iteration(std::size_t /*index*/) noexcept {}

private:
typename std::decay<T>::type var_;
std::decay_t<T> var_;
T curr_;
};

Expand Down Expand Up @@ -132,7 +132,7 @@ namespace pika { namespace parallel { inline namespace v2 {
constexpr void exit_iteration(std::size_t /*index*/) noexcept {}

private:
typename std::decay<T>::type var_;
std::decay_t<T> var_;
T curr_;
std::size_t stride_;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,10 @@ namespace pika { namespace parallel { inline namespace v2 {
/// it the two views to be combined.
///
template <typename T, typename Op>
PIKA_FORCEINLINE constexpr detail::reduction_helper<T,
typename std::decay<Op>::type>
PIKA_FORCEINLINE constexpr detail::reduction_helper<T, std::decay_t<Op>>
reduction(T& var, T const& identity, Op&& combiner)
{
return detail::reduction_helper<T, typename std::decay<Op>::type>(
return detail::reduction_helper<T, std::decay_t<Op>>(
var, identity, PIKA_FORWARD(Op, combiner));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ namespace pika { namespace parallel { inline namespace v1 {
RndIter>::get(PIKA_MOVE(first));
}

using execution_policy = typename std::decay<ExPolicy>::type;
using execution_policy = std::decay_t<ExPolicy>;
using parameters_type =
typename execution_policy::executor_parameters_type;
using executor_type = typename execution_policy::executor_type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ namespace pika { namespace parallel { inline namespace v1 {
}

using buffer_type = typename set_operations_buffer<Iter3>::type;
using func_type = typename std::decay<F>::type;
using func_type = std::decay_t<F>;

// calculate approximate destination index
auto f1 = [](difference_type1 idx1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ namespace pika { namespace parallel { inline namespace v1 {
}

using buffer_type = typename set_operations_buffer<Iter3>::type;
using func_type = typename std::decay<F>::type;
using func_type = std::decay_t<F>;

// calculate approximate destination index
auto f1 = [](difference_type1 idx1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ namespace pika { namespace parallel { inline namespace v1 {
}

using buffer_type = typename set_operations_buffer<Iter3>::type;
using func_type = typename std::decay<F>::type;
using func_type = std::decay_t<F>;

// calculate approximate destination index
auto f1 = [](difference_type1 idx1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ namespace pika { namespace parallel { inline namespace v1 {
}

using buffer_type = typename set_operations_buffer<Iter3>::type;
using func_type = typename std::decay<F>::type;
using func_type = std::decay_t<F>;

// calculate approximate destination index
auto f1 = [](difference_type1 idx1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ namespace pika { namespace parallel { inline namespace v1 {
}

return execution::async_execute(policy.executor(),
&sort_thread<typename std::decay<ExPolicy>::type, RandomIt,
Comp>,
&sort_thread<std::decay_t<ExPolicy>, RandomIt, Comp>,
PIKA_FORWARD(ExPolicy, policy), first, last,
PIKA_FORWARD(Comp, comp), chunk_size);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ namespace pika { namespace parallel { inline namespace v1 {
template <typename F, typename Proj>
struct transform_projected
{
typename std::decay<F>::type& f_;
typename std::decay<Proj>::type& proj_;
std::decay_t<F>& f_;
std::decay_t<Proj>& proj_;

PIKA_HOST_DEVICE constexpr transform_projected(
F& f, Proj& proj) noexcept
Expand All @@ -233,7 +233,7 @@ namespace pika { namespace parallel { inline namespace v1 {
template <typename F>
struct transform_projected<F, util::projection_identity>
{
typename std::decay<F>::type& f_;
std::decay_t<F>& f_;

PIKA_HOST_DEVICE constexpr transform_projected(
F& f, util::projection_identity) noexcept
Expand Down
Loading

0 comments on commit 2d7ba4e

Please sign in to comment.