diff --git a/include/opendht/value.h b/include/opendht/value.h index 30ddf55183c8fa7c950ebf3cdb7cbb5e9235bf2f..26f17bbdf911b80b05ef25d203f594e30064cd35 100644 --- a/include/opendht/value.h +++ b/include/opendht/value.h @@ -130,6 +130,14 @@ struct Value class Filter : public std::function<bool(const Value&)> { using std::function<bool(const Value&)>::function; public: + Filter chain(Filter&& f2) { + auto f1 = *this; + return chain(std::move(f1), std::move(f2)); + } + Filter chainOr(Filter&& f2) { + auto f1 = *this; + return chainOr(std::move(f1), std::move(f2)); + } static Filter chain(Filter&& f1, Filter&& f2) { if (not f1) return f2; if (not f2) return f1; @@ -152,12 +160,6 @@ struct Value return f1(v) or f2(v); }; } - Filter chain(Filter&& f2) { - return chain(std::move(*this), std::move(f2)); - } - Filter chainOr(Filter&& f2) { - return chainOr(std::move(*this), std::move(f2)); - } }; static const Filter AllFilter() {