AK: Make [,Armed]ScopeGuard non-copyable and non-movable

This commit is contained in:
Lucas CHOLLET authored and Nico Weber committed 2025-11-06 20:08:54 -05:00
1 parent 66087b32ce
commit 665ced177c
1 file changed
+7
+7
View File
@@ -6,12 +6,16 @@
#pragma once
#include <AK/Noncopyable.h>
#include <AK/StdLibExtras.h>
namespace AK {
template<typename Callback>
class ScopeGuard {
AK_MAKE_NONCOPYABLE(ScopeGuard);
AK_MAKE_NONMOVABLE(ScopeGuard);
public:
constexpr ScopeGuard(Callback callback)
: m_callback(move(callback))
@@ -29,6 +33,9 @@ private:
template<typename Callback>
class ArmedScopeGuard {
AK_MAKE_NONCOPYABLE(ArmedScopeGuard);
AK_MAKE_NONMOVABLE(ArmedScopeGuard);
public:
ArmedScopeGuard(Callback callback)
: m_callback(move(callback))