Added validity check to task handles and fixed some clang-tidy warning in MIJIN_ASSERT.
This commit is contained in:
@@ -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<TaskSharedState> state = state_.lock())
|
||||
|
||||
Reference in New Issue
Block a user