diff --git a/include/tins/internals.h b/include/tins/internals.h index e408f35..5bf8211 100644 --- a/include/tins/internals.h +++ b/include/tins/internals.h @@ -216,24 +216,26 @@ template struct accepts_type : std::false_type { }; template -struct accepts_type()(std::declval

()) ), bool>::value ->> : std::true_type { }; +struct accepts_type()(std::declval

()) ), bool>::value + >::type +> : std::true_type { }; // use enable_if to invoke the Packet&& version of the sniff_loop handler if possible - otherwise fail to old behavior template bool invoke_loop_cb(Functor& f, Packet& p, typename std::enable_if::value, bool>::type* = 0) { - return f(std::move(p)); + return f(std::move(p)); } template bool invoke_loop_cb(Functor& f, Packet& p, typename std::enable_if::value && accepts_type::value, bool>::type* = 0) { - return f(p); + return f(p); } template bool invoke_loop_cb(Functor& f, Packet& p, typename std::enable_if::value && !accepts_type::value, bool>::type* = 0) { - return f(*p.pdu()); + return f(*p.pdu()); } #endif