From c86ad5c5050b030155a473ef87602ff65c1b68be Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 9 Jan 2025 16:56:40 +0000 Subject: [PATCH] AK: Make ScopeGuard and ArmedScopeGuard [[nodiscard]] Brought to you by a significant amount of pain and suffering, which this would have prevented. --- AK/ScopeGuard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AK/ScopeGuard.h b/AK/ScopeGuard.h index a023a1c68cd..043a37e2750 100644 --- a/AK/ScopeGuard.h +++ b/AK/ScopeGuard.h @@ -11,7 +11,7 @@ namespace AK { template -class ScopeGuard { +class [[nodiscard]] ScopeGuard { public: ScopeGuard(Callback callback) : m_callback(move(callback)) @@ -28,7 +28,7 @@ private: }; template -class ArmedScopeGuard { +class [[nodiscard]] ArmedScopeGuard { public: ArmedScopeGuard(Callback callback) : m_callback(move(callback))