From 9ed0adbab7473f91de6e33f96e7b5fd2449c9c6c Mon Sep 17 00:00:00 2001 From: Denis Blank Date: Thu, 28 Sep 2017 05:24:17 +0200 Subject: [PATCH] Expose the arguments in promises * better IDE support * less instantiations --- .../continuable/continuable-promise-base.hpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/continuable/continuable-promise-base.hpp b/include/continuable/continuable-promise-base.hpp index bacdcf0..af35a0d 100644 --- a/include/continuable/continuable-promise-base.hpp +++ b/include/continuable/continuable-promise-base.hpp @@ -36,10 +36,13 @@ #include #include +#include namespace cti { -template -class promise_base { +template +class promise_base; +template +class promise_base, Data> { /// \cond false // The callback type Data data_; @@ -65,21 +68,18 @@ public: /// \endcond /// Resolves the continuation with the given values - template - void set_value(Args&&... args) { - data_(std::forward(args)...); + void set_value(Args... args) { + data_(std::move(args)...); } /// Resolves the continuation with the given values - template - void operator()(Args&&... args) { - data_(std::forward(args)...); + void operator()(Args... args) { + data_(std::move(args)...); } /// Resolves the continuation with the given error variable. - template - void set_error(Arg&& arg) { - data_(detail::base::dispatch_error_tag{}, std::forward(arg)); + void set_error(detail::base::error_type error) { + data_(detail::base::dispatch_error_tag{}, std::move(error)); } }; } // end namespace cti