X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fscope-exit.hpp;h=3f8c90f80941fbe4384c498c559a6c4d6454be0c;hb=HEAD;hp=e73b5792b776910c5191f6583b27cce2a2d97860;hpb=cd9adb8b829564212158943a0d279bb35322ab30;p=lttng-tools.git diff --git a/src/common/scope-exit.hpp b/src/common/scope-exit.hpp index e73b5792b..3f8c90f80 100644 --- a/src/common/scope-exit.hpp +++ b/src/common/scope-exit.hpp @@ -33,7 +33,8 @@ class scope_exit { public: /* * Since ScopeExitInvocableType will be invoked in the destructor, it - * must be `noexcept` lest we anger the undefined behaviour gods. + * must be `noexcept` lest we anger the undefined behaviour gods by throwing + * an exception while an exception is active. */ static_assert(details::is_invocation_noexcept::value, "scope_exit requires a noexcept invocable type"); @@ -58,6 +59,8 @@ public: * also propagate the scope_exit to another scope, should it be needed. */ scope_exit(const scope_exit&) = delete; + scope_exit& operator=(const scope_exit&) = delete; + scope_exit& operator=(scope_exit&&) = delete; scope_exit() = delete; void disarm() noexcept