1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Move packet into callback to avoid unnecessary clone, fix forward_iterator value type, and update comments

This commit is contained in:
Eric Cornelius
2015-02-06 10:24:43 -05:00
parent eb0b7c9091
commit 184328ea95
2 changed files with 5 additions and 2 deletions

View File

@@ -223,7 +223,7 @@ struct accepts_type<T, P, enable_if_t<
// use enable_if to invoke the Packet& version of the sniff_loop handler if possible - otherwise fail to old behavior
template <class Functor, class Packet>
bool invoke_loop_cb(Functor& f, Packet& p, typename std::enable_if<accepts_type<Functor, Packet>::value, bool>::type* = 0) {
return f(p);
return f(std::move(p));
}
template <class Functor, class Packet>