diff options
| author | Maxime Coste <mawww@kakoune.org> | 2025-07-08 11:52:44 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2025-07-08 12:07:33 +1000 |
| commit | de1516a8d822f72bddfb158126b6e609afc63c64 (patch) | |
| tree | 9765b18349657a766b92046cd23976ad26815acf /src/utils.hh | |
| parent | ce1d512a0c1922ab5f43f28e7bae573508c98601 (diff) | |
Replace on_scope_end with CTAD with OnScopeEnd directly
Diffstat (limited to 'src/utils.hh')
| -rw-r--r-- | src/utils.hh | 10 |
1 files changed, 2 insertions, 8 deletions
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<T>* Singleton<T>::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<typename T> -OnScopeEnd<T> on_scope_end(T t) -{ - return OnScopeEnd<T>{std::move(t)}; -} - // bool that can be set (to true) multiple times, and will // be false only when unset the same time; struct NestedBool |
