From 4fa52c36adf9ccd222e64023e0c674d6d80b921f 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 a023a1c68cdb..043a37e2750e 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 @@ class ScopeGuard { }; template -class ArmedScopeGuard { +class [[nodiscard]] ArmedScopeGuard { public: ArmedScopeGuard(Callback callback) : m_callback(move(callback))