mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Make ScopeGuard and ArmedScopeGuard [[nodiscard]]
Brought to you by a significant amount of pain and suffering, which this would have prevented.
This commit is contained in:
committed by
Tim Ledbetter
parent
10766ecf54
commit
c86ad5c505
@@ -11,7 +11,7 @@
|
||||
namespace AK {
|
||||
|
||||
template<typename Callback>
|
||||
class ScopeGuard {
|
||||
class [[nodiscard]] ScopeGuard {
|
||||
public:
|
||||
ScopeGuard(Callback callback)
|
||||
: m_callback(move(callback))
|
||||
@@ -28,7 +28,7 @@ private:
|
||||
};
|
||||
|
||||
template<typename Callback>
|
||||
class ArmedScopeGuard {
|
||||
class [[nodiscard]] ArmedScopeGuard {
|
||||
public:
|
||||
ArmedScopeGuard(Callback callback)
|
||||
: m_callback(move(callback))
|
||||
|
||||
Reference in New Issue
Block a user