Moved TaskCancelled out of impl namespace and removed errornous noexcept.
This commit is contained in:
parent
ef6830e01c
commit
5eb7864928
@ -49,10 +49,10 @@ class TaskLoop;
|
||||
template<typename TResult = void>
|
||||
class TaskBase;
|
||||
|
||||
namespace impl
|
||||
{
|
||||
struct TaskCancelled : std::exception {};
|
||||
|
||||
namespace impl
|
||||
{
|
||||
inline void throwIfCancelled();
|
||||
} // namespace impl
|
||||
|
||||
@ -126,7 +126,7 @@ struct TaskAwaitableFuture
|
||||
|
||||
[[nodiscard]] constexpr bool await_ready() const noexcept { return future->ready(); }
|
||||
constexpr void await_suspend(std::coroutine_handle<>) const noexcept {}
|
||||
constexpr TValue await_resume() const noexcept
|
||||
constexpr TValue await_resume() const
|
||||
{
|
||||
impl::throwIfCancelled();
|
||||
if constexpr (std::is_same_v<TValue, void>) {
|
||||
@ -606,7 +606,7 @@ inline TaskStatus TaskLoop::tickTask(StoredTask& task)
|
||||
{
|
||||
std::rethrow_exception(task.task->exception());
|
||||
}
|
||||
catch(impl::TaskCancelled&) {} // ignore those
|
||||
catch(TaskCancelled&) {} // ignore those
|
||||
catch(...)
|
||||
{
|
||||
if (uncaughtExceptionHandler_)
|
||||
|
Loading…
x
Reference in New Issue
Block a user