wayland: wayland_proxy ctor improvement
[staging/windowmanager.git] / src / wayland.hpp
index c47e218..5917abf 100644 (file)
@@ -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<struct wl_proxy *>(p));
-        }) {}
-   wayland_proxy(void *p, std::function<void(ProxyT *)> p_del)
+      : wayland_proxy(p,
+                      reinterpret_cast<void (*)(ProxyT *)>(wl_proxy_destroy)) {}
+   wayland_proxy(void *p, std::function<void(ProxyT *)> &&p_del)
       : proxy(std::unique_ptr<ProxyT, std::function<void(ProxyT *)>>(
            static_cast<ProxyT *>(p), p_del)) {}
 };