diff --git a/fluent/Continuable.h b/fluent/Continuable.h index c1114ba..a64da94 100644 --- a/fluent/Continuable.h +++ b/fluent/Continuable.h @@ -192,7 +192,7 @@ namespace detail return typename unary_chainer_t<_CTy>::result_t( [functional, callback](typename unary_chainer_t<_CTy>::callback_t&& call_next) { - callback([functional, call_next](_ATy... args) mutable + callback([functional, call_next](_ATy&&... args) mutable { typename unary_chainer_t<_CTy>::result_t continuable = unary_chainer_t<_CTy>::base::invoke(functional, std::forward<_ATy>(args)...); @@ -228,14 +228,15 @@ namespace detail typedef _ContinuableImpl> type; template - static type invoke(Fn functional, Args... args) + static type invoke(Fn functional, Args&&... args) { // Invoke the void returning functional functional(std::forward(args)...); // Return a fake void continuable - return type([](Callback<>&&) + return type([](Callback<>&& callback) { + callback(); }); } }; @@ -246,7 +247,7 @@ namespace detail typedef _ContinuableImpl<_State, _CTy> type; template - static type invoke(Fn functional, Args... args) + static type invoke(Fn functional, Args&&... args) { return functional(std::forward(args)...); } diff --git a/test.cpp b/test.cpp index 2501168..6395943 100644 --- a/test.cpp +++ b/test.cpp @@ -56,9 +56,9 @@ int main(int /*argc*/, char** /*argv*/) }) .then([](SpellCastResult) { - return Validate(); + std::cout << "Pause a callback (void test) " << std::endl; }) - .then([](bool) + .then([] { return CastSpell(3); })