/*************************************************************************** * Copyright (c) 2016, Johan Mabille, Sylvain Corlay and Wolf Vollprecht * * * * Distributed under the terms of the BSD 3-Clause License. * * * * The full license is in the file LICENSE, distributed with this software. * ****************************************************************************/ #ifndef XTL_XPROXY_WRAPPER_HPP #define XTL_XPROXY_WRAPPER_HPP #include "xclosure.hpp" namespace xtl { template class xproxy_wrapper_impl : public P { public: using self_type = xproxy_wrapper_impl

; using lv_pointer = xclosure_pointer; using rv_pointer = xclosure_pointer

; explicit xproxy_wrapper_impl(P&& rhs) : P(std::move(rhs)) { } inline lv_pointer operator&() & { return lv_pointer(*this); } inline rv_pointer operator&() && { return rv_pointer(std::move(*this)); } }; template using xproxy_wrapper = std::conditional_t::value, xproxy_wrapper_impl

, xclosure_wrapper

>; template inline xproxy_wrapper

proxy_wrapper(P&& proxy) { return xproxy_wrapper

(std::forward

(proxy)); } } #endif