diff --git a/asio/include/asio/bind_allocator.hpp b/asio/include/asio/bind_allocator.hpp index 0c520f0ad1..a9d913aa25 100644 --- a/asio/include/asio/bind_allocator.hpp +++ b/asio/include/asio/bind_allocator.hpp @@ -345,14 +345,21 @@ class allocator_binder /// Forwarding function call operator. template - result_of_t operator()(Args&&... args) + result_of_t operator()(Args&&... args) & { return target_(static_cast(args)...); } /// Forwarding function call operator. template - result_of_t operator()(Args&&... args) const + result_of_t operator()(Args&&... args) && + { + return static_cast(target_)(static_cast(args)...); + } + + /// Forwarding function call operator. + template + result_of_t operator()(Args&&... args) const& { return target_(static_cast(args)...); } diff --git a/asio/include/asio/bind_cancellation_slot.hpp b/asio/include/asio/bind_cancellation_slot.hpp index 321237968c..33fe8fcf86 100644 --- a/asio/include/asio/bind_cancellation_slot.hpp +++ b/asio/include/asio/bind_cancellation_slot.hpp @@ -351,14 +351,21 @@ class cancellation_slot_binder /// Forwarding function call operator. template - result_of_t operator()(Args&&... args) + result_of_t operator()(Args&&... args) & { return target_(static_cast(args)...); } /// Forwarding function call operator. template - result_of_t operator()(Args&&... args) const + result_of_t operator()(Args&&... args) && + { + return static_cast(target_)(static_cast(args)...); + } + + /// Forwarding function call operator. + template + result_of_t operator()(Args&&... args) const& { return target_(static_cast(args)...); } diff --git a/asio/include/asio/bind_executor.hpp b/asio/include/asio/bind_executor.hpp index fcfafe218b..488e45b23d 100644 --- a/asio/include/asio/bind_executor.hpp +++ b/asio/include/asio/bind_executor.hpp @@ -378,14 +378,21 @@ class executor_binder /// Forwarding function call operator. template - result_of_t operator()(Args&&... args) + result_of_t operator()(Args&&... args) & { return this->target_(static_cast(args)...); } /// Forwarding function call operator. template - result_of_t operator()(Args&&... args) const + result_of_t operator()(Args&&... args) && + { + return static_cast(this->target_)(static_cast(args)...); + } + + /// Forwarding function call operator. + template + result_of_t operator()(Args&&... args) const& { return this->target_(static_cast(args)...); } diff --git a/asio/include/asio/bind_immediate_executor.hpp b/asio/include/asio/bind_immediate_executor.hpp index b419c1594b..7be2264d48 100644 --- a/asio/include/asio/bind_immediate_executor.hpp +++ b/asio/include/asio/bind_immediate_executor.hpp @@ -350,14 +350,21 @@ class immediate_executor_binder /// Forwarding function call operator. template - result_of_t operator()(Args&&... args) + result_of_t operator()(Args&&... args) & { return target_(static_cast(args)...); } /// Forwarding function call operator. template - result_of_t operator()(Args&&... args) const + result_of_t operator()(Args&&... args) && + { + return static_cast(target_)(static_cast(args)...); + } + + /// Forwarding function call operator. + template + result_of_t operator()(Args&&... args) const& { return target_(static_cast(args)...); }