From 053ca969fe869d38d92319415e2a8cacbaebf0e7 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Wed, 28 Jun 2017 16:36:54 +0200 Subject: [PATCH] wayland: wayland_proxy ctor improvement * Take the std::function by rval reference. * Do not create a lambda for the wl_proxy_destroy deleter. Signed-off-by: Marcus Fritzsch --- src/wayland.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/wayland.hpp b/src/wayland.hpp index c47e218..5917abf 100644 --- a/src/wayland.hpp +++ b/src/wayland.hpp @@ -22,10 +22,9 @@ struct wayland_proxy { wayland_proxy(wayland_proxy const &) = delete; wayland_proxy &operator=(wayland_proxy const &) = delete; wayland_proxy(void *p) - : wayland_proxy(p, [](ProxyT *p) { - wl_proxy_destroy(reinterpret_cast(p)); - }) {} - wayland_proxy(void *p, std::function p_del) + : wayland_proxy(p, + reinterpret_cast(wl_proxy_destroy)) {} + wayland_proxy(void *p, std::function &&p_del) : proxy(std::unique_ptr>( static_cast(p), p_del)) {} }; -- 2.16.6