Commit e4b1bb30 authored by Dominik Charousset's avatar Dominik Charousset

Fix unused-but-set-variable warning

parent c41f1c24
...@@ -26,9 +26,8 @@ struct select_any_factory<F, type_list<Ts...>> { ...@@ -26,9 +26,8 @@ struct select_any_factory<F, type_list<Ts...>> {
template <class Fun> template <class Fun>
static auto static auto
make(std::shared_ptr<size_t> pending, disposable timeouts, Fun f) { make(std::shared_ptr<size_t> pending, disposable timeouts, Fun f) {
using std::move; return [pending{std::move(pending)}, timeouts{std::move(timeouts)},
return [pending{move(pending)}, timeouts{move(timeouts)}, f{std::move(f)}](Ts... xs) mutable {
f{move(f)}](Ts... xs) mutable {
CAF_LOG_TRACE(CAF_ARG2("pending", *pending)); CAF_LOG_TRACE(CAF_ARG2("pending", *pending));
if (*pending > 0) { if (*pending > 0) {
timeouts.dispose(); timeouts.dispose();
......
...@@ -286,8 +286,8 @@ public: ...@@ -286,8 +286,8 @@ public:
template <class F> template <class F>
std::enable_if_t<std::is_invocable_r_v<skippable_result, F, message&>> std::enable_if_t<std::is_invocable_r_v<skippable_result, F, message&>>
set_default_handler(F fun) { set_default_handler(F fun) {
using std::move; default_handler_ = [fn{std::move(fun)}](scheduled_actor*,
default_handler_ = [fn{move(fun)}](scheduled_actor*, message& xs) mutable { message& xs) mutable {
return fn(xs); return fn(xs);
}; };
} }
...@@ -319,10 +319,8 @@ public: ...@@ -319,10 +319,8 @@ public:
/// Sets a custom handler for down messages. /// Sets a custom handler for down messages.
template <class F> template <class F>
std::enable_if_t<std::is_invocable_v<F, down_msg&>> set_down_handler(F fun) { std::enable_if_t<std::is_invocable_v<F, down_msg&>> set_down_handler(F fun) {
using std::move; down_handler_ = [fn{std::move(fun)}](scheduled_actor*,
down_handler_ = [fn{move(fun)}](scheduled_actor*, down_msg& x) mutable { down_msg& x) mutable { fn(x); };
fn(x);
};
} }
/// Sets a custom handler for node down messages. /// Sets a custom handler for node down messages.
...@@ -354,10 +352,8 @@ public: ...@@ -354,10 +352,8 @@ public:
/// Sets a custom handler for exit messages. /// Sets a custom handler for exit messages.
template <class F> template <class F>
std::enable_if_t<std::is_invocable_v<F, exit_msg&>> set_exit_handler(F fun) { std::enable_if_t<std::is_invocable_v<F, exit_msg&>> set_exit_handler(F fun) {
using std::move; exit_handler_ = [fn{std::move(fun)}](scheduled_actor*,
exit_handler_ = [fn{move(fun)}](scheduled_actor*, exit_msg& x) mutable { exit_msg& x) mutable { fn(x); };
fn(x);
};
} }
#ifdef CAF_ENABLE_EXCEPTIONS #ifdef CAF_ENABLE_EXCEPTIONS
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
/// @warning Must not be modified outside the IO multiplexers event loop /// @warning Must not be modified outside the IO multiplexers event loop
/// once the stream has been started. /// once the stream has been started.
void enqueue_datagram(datagram_handle hdl, byte_buffer buf) { void enqueue_datagram(datagram_handle hdl, byte_buffer buf) {
wr_offline_buf_.emplace_back(hdl, move(buf)); wr_offline_buf_.emplace_back(hdl, std::move(buf));
} }
/// Returns the read buffer of this stream. /// Returns the read buffer of this stream.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment