From de1516a8d822f72bddfb158126b6e609afc63c64 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 8 Jul 2025 11:52:44 +1000 Subject: Replace on_scope_end with CTAD with OnScopeEnd directly --- src/utils.hh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/utils.hh') diff --git a/src/utils.hh b/src/utils.hh index ba8cf737..5ec5b334 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -51,11 +51,11 @@ Singleton* Singleton::ms_instance = nullptr; // *** On scope end *** // -// on_scope_end provides a way to register some code to be +// OnScopeEnd provides a way to register some code to be // executed when current scope closes. // // usage: -// auto cleaner = on_scope_end([]() { ... }); +// auto cleaner = OnScopeEnd([]() { ... }); // // This permits to cleanup c-style resources without implementing // a wrapping class @@ -82,12 +82,6 @@ private: T m_func; }; -template -OnScopeEnd on_scope_end(T t) -{ - return OnScopeEnd{std::move(t)}; -} - // bool that can be set (to true) multiple times, and will // be false only when unset the same time; struct NestedBool -- cgit v1.2.3