Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions aether/actions/action_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ class OwnActionPtr : public ActionPtr<TAction> {
template <typename UAction>
friend class OwnActionPtr;

static_assert(ActionStoppable<TAction>::value, "TAction must be stoppable");
OwnActionPtr() = default;

template <typename... TArgs>
explicit OwnActionPtr(ActionContext action_context, TArgs&&... args)
: ActionPtr<TAction>{action_context, std::forward<TArgs>(args)...} {}
: ActionPtr<TAction>{action_context, std::forward<TArgs>(args)...} {
static_assert(ActionStoppable<TAction>::value, "TAction must be stoppable");
}

OwnActionPtr(OwnActionPtr<TAction>&& other) noexcept
: ActionPtr<TAction>{std::move(other)} {}
Expand Down Expand Up @@ -145,8 +146,8 @@ class OwnActionPtr : public ActionPtr<TAction> {

void reset() {
if (ActionPtr<TAction>::operator bool()) {
if (!ActionPtr<TAction>::operator->() -> IsFinished()) {
ActionPtr<TAction>::operator->() -> Stop();
if (!ActionPtr<TAction>::operator->()->IsFinished()) {
ActionPtr<TAction>::operator->()->Stop();
}
}
ActionPtr<TAction>::reset();
Expand Down
Loading