improvements

This commit is contained in:
Michele Caini 2016-06-29 08:54:13 +02:00
parent b2f992f5e4
commit b944a28c38
5 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ public:
void start(std::function<void(UVWError, Check &)> cb) noexcept {
using CBF = CallbackFactory<void(uv_check_t *)>;
auto func = CBF::on<&Check::startCallback>(*this, cb);
auto func = CBF::on<&Check::startCallback>(*this, std::move(cb));
auto err = uv_check_start(get<uv_check_t>(), func);
if(err) { error(err); }
}

View File

@ -30,7 +30,7 @@ public:
void start(std::function<void(UVWError, Idle &)> cb) noexcept {
using CBF = CallbackFactory<void(uv_idle_t *)>;
auto func = CBF::on<&Idle::startCallback>(*this, cb);
auto func = CBF::on<&Idle::startCallback>(*this, std::move(cb));
auto err = uv_idle_start(get<uv_idle_t>(), func);
if(err) { error(err); }
}

View File

@ -30,7 +30,7 @@ public:
void start(std::function<void(UVWError, Prepare &)> cb) noexcept {
using CBF = CallbackFactory<void(uv_prepare_t *)>;
auto func = CBF::on<&Prepare::startCallback>(*this, cb);
auto func = CBF::on<&Prepare::startCallback>(*this, std::move(cb));
auto err = uv_prepare_start(get<uv_prepare_t>(), func);
if(err) { error(err); }
}

View File

@ -100,7 +100,7 @@ public:
typename Traits::Type addr;
Traits::AddrFunc(ip.c_str(), port, &addr);
using CBF = CallbackFactory<void(uv_connect_t *, int)>;
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<uv_tcp_t>(), reinterpret_cast<const sockaddr *>(&addr), func);
if(err) { error(err); }
}

View File

@ -34,7 +34,7 @@ public:
void start(const Time &timeout, const Time &rep, std::function<void(UVWError, Timer &)> cb) noexcept {
using CBF = CallbackFactory<void(uv_timer_t *)>;
auto func = CBF::on<&Timer::startCallback>(*this, cb);
auto func = CBF::on<&Timer::startCallback>(*this, std::move(cb));
auto err = uv_timer_start(get<uv_timer_t>(), func, timeout.count(), rep.count());
if(err) { error(err); }
}