mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-06-23 19:48:32 +00:00
Impl ViralNonPostingInv; fix member coro thisptr;
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <exception>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <typeinfo>
|
||||
#include <thread>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
@@ -267,6 +268,22 @@ struct PostingPromise
|
||||
postBackStatus(*this)
|
||||
{}
|
||||
|
||||
/** Member coroutines pass the implicit object parameter before explicit
|
||||
* (exceptionPtr, callback, ...) args. Discard the object and delegate to
|
||||
* the free-function constructor shape.
|
||||
*/
|
||||
template <typename ObjectArg, typename... TailArgs>
|
||||
requires (!std::same_as<std::remove_cvref_t<ObjectArg>, std::exception_ptr>)
|
||||
PostingPromise(
|
||||
ObjectArg &&,
|
||||
std::exception_ptr &_callerExceptionPtr,
|
||||
std::function<void()> _callerLambda,
|
||||
TailArgs &&...) noexcept
|
||||
: PostingPromise(
|
||||
_callerExceptionPtr,
|
||||
std::move(_callerLambda))
|
||||
{}
|
||||
|
||||
~PostingPromise() noexcept
|
||||
{
|
||||
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
||||
@@ -345,6 +362,19 @@ struct TaggedPostingPromise
|
||||
std::forward<TailArgs>(tailArgs)...)
|
||||
{}
|
||||
|
||||
template <typename ObjectArg, typename... TailArgs>
|
||||
requires (!std::same_as<std::remove_cvref_t<ObjectArg>, std::exception_ptr>)
|
||||
TaggedPostingPromise(
|
||||
ObjectArg &&,
|
||||
std::exception_ptr &_exceptionPtr,
|
||||
std::function<void()> _callerLambda,
|
||||
TailArgs &&... tailArgs) noexcept
|
||||
: PostingPromise<T>(
|
||||
_exceptionPtr,
|
||||
std::move(_callerLambda),
|
||||
std::forward<TailArgs>(tailArgs)...)
|
||||
{}
|
||||
|
||||
auto initial_suspend() noexcept
|
||||
{
|
||||
#ifdef CONFIG_LIBSSCL_DEBUG_CO
|
||||
|
||||
Reference in New Issue
Block a user