Skip to content

Commit 9903837

Browse files
committed
Remove unnecessary auto&& in ireduce.
1 parent 1df5d77 commit 9903837

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

include/kamping/collectives/iallreduce.hpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ auto kamping::Communicator<DefaultContainerType, Plugins...>::iallreduce(Args...
8282
);
8383

8484
// Get the send buffer and deduce the send and recv value types.
85-
auto&& send_buf = select_parameter_type<ParameterType::send_buf>(args...).construct_buffer_or_rebind();
85+
auto send_buf = select_parameter_type<ParameterType::send_buf>(args...).construct_buffer_or_rebind();
8686
using send_value_type = typename std::remove_reference_t<decltype(send_buf)>::value_type;
8787
using default_recv_value_type = std::remove_const_t<send_value_type>;
8888

8989
// Deduce the recv buffer type and get (if provided) the recv buffer or allocate one (if not provided).
9090
using default_recv_buf_type = decltype(kamping::recv_buf(alloc_new<DefaultContainerType<default_recv_value_type>>));
91-
auto&& recv_buf =
91+
auto recv_buf =
9292
select_parameter_type_or_default<ParameterType::recv_buf, default_recv_buf_type>(std::tuple(), args...)
9393
.template construct_buffer_or_rebind<DefaultContainerType>();
9494
using recv_value_type = typename std::remove_reference_t<decltype(recv_buf)>::value_type;
@@ -98,7 +98,7 @@ auto kamping::Communicator<DefaultContainerType, Plugins...>::iallreduce(Args...
9898
);
9999

100100
// Get the send_recv_type.
101-
auto&& send_recv_type = determine_mpi_send_recv_datatype<send_value_type, decltype(recv_buf)>(args...);
101+
auto send_recv_type = determine_mpi_send_recv_datatype<send_value_type, decltype(recv_buf)>(args...);
102102
[[maybe_unused]] constexpr bool send_recv_type_is_in_param = !has_to_be_computed<decltype(send_recv_type)>;
103103

104104
// Get the operation used for the reduction. The signature of the provided function is checked while
@@ -114,10 +114,10 @@ auto kamping::Communicator<DefaultContainerType, Plugins...>::iallreduce(Args...
114114
BufferResizePolicy::no_resize>(std::move(op));
115115
}();
116116
using default_send_recv_count_type = decltype(kamping::send_recv_count_out());
117-
auto&& send_recv_count = internal::select_parameter_type_or_default<
118-
internal::ParameterType::send_recv_count,
119-
default_send_recv_count_type>({}, args...)
120-
.construct_buffer_or_rebind();
117+
auto send_recv_count = internal::select_parameter_type_or_default<
118+
internal::ParameterType::send_recv_count,
119+
default_send_recv_count_type>({}, args...)
120+
.construct_buffer_or_rebind();
121121
if constexpr (has_to_be_computed<decltype(send_recv_count)>) {
122122
send_recv_count.underlying() = asserting_cast<int>(send_buf.size());
123123
}

0 commit comments

Comments
 (0)