diff --git a/NextGen.cpp b/NextGen.cpp index 14478af..8401e15 100644 --- a/NextGen.cpp +++ b/NextGen.cpp @@ -222,7 +222,7 @@ auto createProxyCallback(Callback&& callback, } template -auto appendHandlerToContinuation(Continuation&& continuation, +auto appendCallback(Continuation&& continuation, Callback&& callback) { return [continuation = std::forward(continuation), @@ -294,8 +294,8 @@ public: template auto then(Callback&& callback)&& { - auto next = appendHandlerToContinuation(std::move(continuation), - std::forward(callback)); + auto next = appendCallback(std::move(continuation), + std::forward(callback)); using Transformed = ContinuableBase< typename Config::template ChangeContinuationTo >; @@ -306,8 +306,7 @@ public: template auto then(Callback&& callback) const& { - auto next = appendHandlerToContinuation(continuation, - std::forward(callback)); + auto next = appendCallback(continuation, std::forward(callback)); using Transformed = ContinuableBase< typename Config::template ChangeContinuationTo >; @@ -317,25 +316,19 @@ public: } template - auto post(NewDispatcher&& newDispatcher)&& { - using Transformed = ContinuableBase< - typename Config::template ChangeDispatcherTo> - >; - return Transformed { - std::move(continuation), std::move(ownership), - std::forward(newDispatcher) - }; + auto post(NewDispatcher&& newDispatcher)&& + -> ContinuableBase>> { + return { std::move(continuation), std::move(ownership), + std::forward(newDispatcher) }; } template - auto post(NewDispatcher&& newDispatcher) const& { - using Transformed = ContinuableBase< - typename Config::template ChangeDispatcherTo> - >; - return Transformed { - continuation, ownership, - std::forward(newDispatcher) - }; + auto post(NewDispatcher&& newDispatcher) const& + -> ContinuableBase>> { + return { continuation, ownership, + std::forward(newDispatcher) }; } private: