mirror of
https://github.com/Naios/continuable.git
synced 2026-02-16 23:29:48 +08:00
more
This commit is contained in:
parent
6d0d0cfa94
commit
e2ee851100
35
NextGen.cpp
35
NextGen.cpp
@ -222,7 +222,7 @@ auto createProxyCallback(Callback&& callback,
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename Continuation, typename Callback>
|
template<typename Continuation, typename Callback>
|
||||||
auto appendHandlerToContinuation(Continuation&& continuation,
|
auto appendCallback(Continuation&& continuation,
|
||||||
Callback&& callback) {
|
Callback&& callback) {
|
||||||
|
|
||||||
return [continuation = std::forward<Continuation>(continuation),
|
return [continuation = std::forward<Continuation>(continuation),
|
||||||
@ -294,8 +294,8 @@ public:
|
|||||||
|
|
||||||
template<typename Callback>
|
template<typename Callback>
|
||||||
auto then(Callback&& callback)&& {
|
auto then(Callback&& callback)&& {
|
||||||
auto next = appendHandlerToContinuation(std::move(continuation),
|
auto next = appendCallback(std::move(continuation),
|
||||||
std::forward<Callback>(callback));
|
std::forward<Callback>(callback));
|
||||||
using Transformed = ContinuableBase<
|
using Transformed = ContinuableBase<
|
||||||
typename Config::template ChangeContinuationTo<decltype(next)>
|
typename Config::template ChangeContinuationTo<decltype(next)>
|
||||||
>;
|
>;
|
||||||
@ -306,8 +306,7 @@ public:
|
|||||||
|
|
||||||
template<typename Callback>
|
template<typename Callback>
|
||||||
auto then(Callback&& callback) const& {
|
auto then(Callback&& callback) const& {
|
||||||
auto next = appendHandlerToContinuation(continuation,
|
auto next = appendCallback(continuation, std::forward<Callback>(callback));
|
||||||
std::forward<Callback>(callback));
|
|
||||||
using Transformed = ContinuableBase<
|
using Transformed = ContinuableBase<
|
||||||
typename Config::template ChangeContinuationTo<decltype(next)>
|
typename Config::template ChangeContinuationTo<decltype(next)>
|
||||||
>;
|
>;
|
||||||
@ -317,25 +316,19 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename NewDispatcher>
|
template<typename NewDispatcher>
|
||||||
auto post(NewDispatcher&& newDispatcher)&& {
|
auto post(NewDispatcher&& newDispatcher)&&
|
||||||
using Transformed = ContinuableBase<
|
-> ContinuableBase<typename Config::template
|
||||||
typename Config::template ChangeDispatcherTo<std::decay_t<NewDispatcher>>
|
ChangeDispatcherTo<std::decay_t<NewDispatcher>>> {
|
||||||
>;
|
return { std::move(continuation), std::move(ownership),
|
||||||
return Transformed {
|
std::forward<NewDispatcher>(newDispatcher) };
|
||||||
std::move(continuation), std::move(ownership),
|
|
||||||
std::forward<NewDispatcher>(newDispatcher)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename NewDispatcher>
|
template<typename NewDispatcher>
|
||||||
auto post(NewDispatcher&& newDispatcher) const& {
|
auto post(NewDispatcher&& newDispatcher) const&
|
||||||
using Transformed = ContinuableBase<
|
-> ContinuableBase<typename Config::template
|
||||||
typename Config::template ChangeDispatcherTo<std::decay_t<NewDispatcher>>
|
ChangeDispatcherTo<std::decay_t<NewDispatcher>>> {
|
||||||
>;
|
return { continuation, ownership,
|
||||||
return Transformed {
|
std::forward<NewDispatcher>(newDispatcher) };
|
||||||
continuation, ownership,
|
|
||||||
std::forward<NewDispatcher>(newDispatcher)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user