From 7919240dcf4a373d3bd7a4e6d23d1815cc13dc24 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 29 Jun 2025 14:04:29 +1000 Subject: Fix compilation with compilers not supporting auto(x) --- src/utils.hh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/utils.hh') diff --git a/src/utils.hh b/src/utils.hh index 4b84ce75..b517735f 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -72,6 +72,9 @@ public: : m_valid{other.m_valid}, m_func{std::move(other.m_func)} { other.m_valid = false; } + [[gnu::always_inline]] + void trigger() { if (m_valid) m_func(); m_valid = false; } + [[gnu::always_inline]] ~OnScopeEnd() noexcept(noexcept(m_func())) { if (m_valid) m_func(); } -- cgit v1.2.3