From 184328ea95154ff40eeae88730561899fa905ee7 Mon Sep 17 00:00:00 2001 From: Eric Cornelius Date: Fri, 6 Feb 2015 10:24:43 -0500 Subject: [PATCH] Move packet into callback to avoid unnecessary clone, fix forward_iterator value type, and update comments --- include/tins/internals.h | 2 +- include/tins/sniffer.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/tins/internals.h b/include/tins/internals.h index 8806c9d..25debb9 100644 --- a/include/tins/internals.h +++ b/include/tins/internals.h @@ -223,7 +223,7 @@ struct accepts_type bool invoke_loop_cb(Functor& f, Packet& p, typename std::enable_if::value, bool>::type* = 0) { - return f(p); + return f(std::move(p)); } template diff --git a/include/tins/sniffer.h b/include/tins/sniffer.h index 26fd21c..5d853e9 100644 --- a/include/tins/sniffer.h +++ b/include/tins/sniffer.h @@ -139,6 +139,9 @@ namespace Tins { * \code * bool(PDU&); * bool(const PDU&); + * bool(const Packet&); + * bool(Packet&&); + * bool(Packet); * \endcode * * This functor will be called using the each of the sniffed packets @@ -391,7 +394,7 @@ namespace Tins { /** * \brief Iterates over packets sniffed by a BaseSniffer. */ - class SnifferIterator : public std::iterator { + class SnifferIterator : public std::iterator { public: /** * Constructs a SnifferIterator.