From 8eb3db11139b9a4d9b9056e2cd3412f7ebb48718 Mon Sep 17 00:00:00 2001 From: azw Date: Sat, 19 Aug 2023 00:01:57 +0800 Subject: [PATCH] 1 --- f8/coroutine.cc | 5 +++-- f8/coroutine.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/f8/coroutine.cc b/f8/coroutine.cc index 01679c4..a094bcb 100644 --- a/f8/coroutine.cc +++ b/f8/coroutine.cc @@ -97,9 +97,10 @@ namespace f8 return awaiter->GetResult(); } - std::shared_ptr Coroutine::CoAwait(std::function<(std::shared_ptr)> cb) + std::shared_ptr Coroutine::CoAwait + (std::function)> cb) { - + return CoAwait(std::make_shared(cb)); } void Coroutine::Attach() diff --git a/f8/coroutine.h b/f8/coroutine.h index 6ca251f..2ba5846 100644 --- a/f8/coroutine.h +++ b/f8/coroutine.h @@ -19,7 +19,8 @@ namespace f8 void CoResume(); void CoYield(); std::shared_ptr CoAwait(std::shared_ptr awaiter); - std::shared_ptr CoAwait(std::function<(std::shared_ptr)> cb); + std::shared_ptr CoAwait + (std::function)> cb); std::shared_ptr Sleep(long long time); private: