From 84ca172caa3f5c16304a80c4d087d5c58928baf1 Mon Sep 17 00:00:00 2001 From: Denis Blank Date: Wed, 4 Oct 2017 17:16:58 +0200 Subject: [PATCH] Qualify continuable callbacks as r-value callable --- .../continuable/continuable-promise-base.hpp | 12 +++++------ include/continuable/continuable-trait.hpp | 4 ++-- include/continuable/detail/base.hpp | 20 +++++++++++-------- include/continuable/detail/composition.hpp | 12 +++++------ test/playground/test-playground.cpp | 10 +++++----- 5 files changed, 31 insertions(+), 27 deletions(-) diff --git a/include/continuable/continuable-promise-base.hpp b/include/continuable/continuable-promise-base.hpp index a48122c..2d568cd 100644 --- a/include/continuable/continuable-promise-base.hpp +++ b/include/continuable/continuable-promise-base.hpp @@ -72,29 +72,29 @@ public: /// Resolves the continuation with the given values /// /// \since version 2.0.0 - void operator()(Args... args) { - data_(std::move(args)...); + void operator()(Args... args) && { + std::move(data_)(std::move(args)...); } /// Resolves the continuation with the given exception /// /// \since version 2.0.0 void operator()(detail::types::dispatch_error_tag tag, - detail::types::error_type exception) { - data_(tag, std::move(exception)); + detail::types::error_type exception) && { + std::move(data_)(tag, std::move(exception)); } /// Resolves the continuation with the given values /// /// \since version 2.0.0 void set_value(Args... args) { - data_(std::move(args)...); + std::move(data_)(std::move(args)...); } /// Resolves the continuation with the given exception /// /// \since version 2.0.0 void set_exception(detail::types::error_type exception) { - data_(detail::types::dispatch_error_tag{}, std::move(exception)); + std::move(data_)(detail::types::dispatch_error_tag{}, std::move(exception)); } }; } // namespace cti diff --git a/include/continuable/continuable-trait.hpp b/include/continuable/continuable-trait.hpp index c3e714d..292f14a 100644 --- a/include/continuable/continuable-trait.hpp +++ b/include/continuable/continuable-trait.hpp @@ -54,8 +54,8 @@ template