diff --git a/source/mijin/async/coroutine.hpp b/source/mijin/async/coroutine.hpp index f77386f..36f0284 100644 --- a/source/mijin/async/coroutine.hpp +++ b/source/mijin/async/coroutine.hpp @@ -416,6 +416,11 @@ public: TaskHandle& operator=(const TaskHandle&) = default; TaskHandle& operator=(TaskHandle&&) = default; + [[nodiscard]] bool isValid() const noexcept + { + return !state_.expired(); + } + void cancel() const noexcept { if (std::shared_ptr state = state_.lock()) diff --git a/source/mijin/debug/assert.hpp b/source/mijin/debug/assert.hpp index 336cf6c..44bea03 100644 --- a/source/mijin/debug/assert.hpp +++ b/source/mijin/debug/assert.hpp @@ -56,15 +56,15 @@ if (!static_cast(condition)) /* static bool ignoreAll = false; */ \ if (true) /*!ignoreAll */ \ { \ - mijin::AssertionResult assertion_result__ = mijin::handleAssert(#condition,\ - msg, MIJIN_FUNC(), __FILE__, __LINE__); \ + const mijin::AssertionResult assertion_result__ = mijin::handleAssert( \ + #condition, msg, MIJIN_FUNC(), __FILE__, __LINE__); \ switch (assertion_result__) \ { \ case mijin::AssertionResult::ABORT: \ std::abort(); \ break; \ case mijin::AssertionResult::IGNORE: \ - break; \ + /*break*/; \ case mijin::AssertionResult::IGNORE_ALL: \ /* ignoreAll = true; */ \ break; \