Skip to content

Commit

Permalink
AK: Make ScopeGuard and ArmedScopeGuard [[nodiscard]]
Browse files Browse the repository at this point in the history
Brought to you by a significant amount of pain and suffering, which this
would have prevented.
  • Loading branch information
AtkinsSJ authored and tcl3 committed Jan 9, 2025
1 parent 10766ec commit c86ad5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AK/ScopeGuard.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace AK {

template<typename Callback>
class ScopeGuard {
class [[nodiscard]] ScopeGuard {
public:
ScopeGuard(Callback callback)
: m_callback(move(callback))
Expand All @@ -28,7 +28,7 @@ class ScopeGuard {
};

template<typename Callback>
class ArmedScopeGuard {
class [[nodiscard]] ArmedScopeGuard {
public:
ArmedScopeGuard(Callback callback)
: m_callback(move(callback))
Expand Down

0 comments on commit c86ad5c

Please sign in to comment.