From b944a28c38d105342182bc24ed79021bb68b4982 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 29 Jun 2016 08:54:13 +0200 Subject: [PATCH] improvements --- src/uvw/check.hpp | 2 +- src/uvw/idle.hpp | 2 +- src/uvw/prepare.hpp | 2 +- src/uvw/tcp.hpp | 2 +- src/uvw/timer.hpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/uvw/check.hpp b/src/uvw/check.hpp index 31b988a0..4ecdd9f6 100644 --- a/src/uvw/check.hpp +++ b/src/uvw/check.hpp @@ -30,7 +30,7 @@ public: void start(std::function cb) noexcept { using CBF = CallbackFactory; - auto func = CBF::on<&Check::startCallback>(*this, cb); + auto func = CBF::on<&Check::startCallback>(*this, std::move(cb)); auto err = uv_check_start(get(), func); if(err) { error(err); } } diff --git a/src/uvw/idle.hpp b/src/uvw/idle.hpp index f38af571..29165437 100644 --- a/src/uvw/idle.hpp +++ b/src/uvw/idle.hpp @@ -30,7 +30,7 @@ public: void start(std::function cb) noexcept { using CBF = CallbackFactory; - auto func = CBF::on<&Idle::startCallback>(*this, cb); + auto func = CBF::on<&Idle::startCallback>(*this, std::move(cb)); auto err = uv_idle_start(get(), func); if(err) { error(err); } } diff --git a/src/uvw/prepare.hpp b/src/uvw/prepare.hpp index 06ccc4c4..dc9fb584 100644 --- a/src/uvw/prepare.hpp +++ b/src/uvw/prepare.hpp @@ -30,7 +30,7 @@ public: void start(std::function cb) noexcept { using CBF = CallbackFactory; - auto func = CBF::on<&Prepare::startCallback>(*this, cb); + auto func = CBF::on<&Prepare::startCallback>(*this, std::move(cb)); auto err = uv_prepare_start(get(), func); if(err) { error(err); } } diff --git a/src/uvw/tcp.hpp b/src/uvw/tcp.hpp index 9115dba1..4c7ee787 100644 --- a/src/uvw/tcp.hpp +++ b/src/uvw/tcp.hpp @@ -100,7 +100,7 @@ public: typename Traits::Type addr; Traits::AddrFunc(ip.c_str(), port, &addr); using CBF = CallbackFactory; - auto func = CBF::template once<&Tcp::connectCallback>(*this, cb); + auto func = CBF::template once<&Tcp::connectCallback>(*this, std::move(cb)); auto err = uv_tcp_connect(conn.get(), get(), reinterpret_cast(&addr), func); if(err) { error(err); } } diff --git a/src/uvw/timer.hpp b/src/uvw/timer.hpp index d6270d6f..50433d9e 100644 --- a/src/uvw/timer.hpp +++ b/src/uvw/timer.hpp @@ -34,7 +34,7 @@ public: void start(const Time &timeout, const Time &rep, std::function cb) noexcept { using CBF = CallbackFactory; - auto func = CBF::on<&Timer::startCallback>(*this, cb); + auto func = CBF::on<&Timer::startCallback>(*this, std::move(cb)); auto err = uv_timer_start(get(), func, timeout.count(), rep.count()); if(err) { error(err); } }