Catch more exceptions
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef AOCPP_GENERATOR_HPP_
|
||||
#define AOCPP_GENERATOR_HPP_
|
||||
|
||||
#include <concepts>
|
||||
#include <exception>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
@@ -35,7 +36,7 @@ public:
|
||||
{
|
||||
return Generator{handle_type::from_promise(*this)};
|
||||
}
|
||||
co::suspend_always initial_suspend() { return {}; }
|
||||
co::suspend_always initial_suspend() noexcept { return {}; }
|
||||
co::suspend_always final_suspend() noexcept { return {}; }
|
||||
void unhandled_exception() { exception_ = std::current_exception(); }
|
||||
|
||||
@@ -50,10 +51,10 @@ public:
|
||||
|
||||
public:
|
||||
Generator() noexcept = default;
|
||||
Generator(handle_type h) : h_(h) {}
|
||||
Generator(Generator && g) : h_{g.h_} { g.h_ = nullptr; };
|
||||
Generator(Generator const& g) = delete;
|
||||
Generator(handle_type h) noexcept : h_(h) {}
|
||||
Generator(Generator && g) noexcept : h_{std::move(g.h_)} { g.h_ = nullptr; };
|
||||
Generator & operator=(Generator && rhs) = delete;
|
||||
Generator(Generator const& g) = delete;
|
||||
Generator & operator=(Generator const& rhs) = delete;
|
||||
~Generator() { if (h_) h_.destroy(); }
|
||||
std::optional<T> operator()()
|
||||
|
Reference in New Issue
Block a user