diff --git a/llarp/ev/libuv.hpp b/llarp/ev/libuv.hpp index 2d9cff015..422f8f1c9 100644 --- a/llarp/ev/libuv.hpp +++ b/llarp/ev/libuv.hpp @@ -2,7 +2,6 @@ #include "ev.hpp" #include "udp_handle.hpp" -#include #include // #include diff --git a/llarp/router/router.cpp b/llarp/router/router.cpp index 2e9f13770..ded6221b3 100644 --- a/llarp/router/router.cpp +++ b/llarp/router/router.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -692,7 +691,7 @@ namespace llarp _contacts, _node_db, _loop, - util::memFn(&Router::queue_work, this), + [this](std::function work) { queue_work(std::move(work)); }, &_link_manager, &_hidden_service_context, strictConnectPubkeys, diff --git a/llarp/service/async_key_exchange.cpp b/llarp/service/async_key_exchange.cpp index 3dbf2ea75..ab3e9934c 100644 --- a/llarp/service/async_key_exchange.cpp +++ b/llarp/service/async_key_exchange.cpp @@ -4,7 +4,6 @@ #include #include -#include #include diff --git a/llarp/util/meta/memfn.hpp b/llarp/util/meta/memfn.hpp deleted file mode 100644 index b7a408560..000000000 --- a/llarp/util/meta/memfn.hpp +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef LLARP_UTIL_MEMFN -#define LLARP_UTIL_MEMFN - -#include -#include -#include - -namespace llarp::util -{ - // Wraps a member function and instance into a callable object that invokes - // the method (non-const overload). - template < - typename Return, - typename Class, - typename Derived, - typename... Arg, - typename = std::enable_if_t::value>> - auto - memFn(Return (Class::*f)(Arg...), Derived* self) - { - return [f, self](Arg... args) -> Return { return (self->*f)(std::forward(args)...); }; - } - - // Wraps a member function and instance into a lambda that invokes the - // method (const overload). - template < - typename Return, - typename Class, - typename Derived, - typename... Arg, - typename = std::enable_if_t::value>> - auto - memFn(Return (Class::*f)(Arg...) const, const Derived* self) - { - return [f, self](Arg... args) -> Return { return (self->*f)(std::forward(args)...); }; - } - - // Wraps a member function and shared pointer to an instance into a lambda - // that invokes the method. - template < - typename Return, - typename Class, - typename Derived, - typename... Arg, - typename = std::enable_if_t::value>> - auto - memFn(Return (Class::*f)(Arg...), std::shared_ptr self) - { - return [f, self = std::move(self)](Arg... args) -> Return { - return (self.get()->*f)(std::forward(args)...); - }; - } - - // Wraps a member function and shared pointer to an instance into a lambda - // that invokes the method (const method overload). - template < - typename Return, - typename Class, - typename Derived, - typename... Arg, - typename = std::enable_if_t::value>> - auto - memFn(Return (Class::*f)(Arg...) const, std::shared_ptr self) - { - return [f, self = std::move(self)](Arg... args) -> Return { - return (self.get()->*f)(std::forward(args)...); - }; - } - -} // namespace llarp::util - -#endif