Skip to content

Commit 7919240

Browse files
committed
Fix compilation with compilers not supporting auto(x)
1 parent 8561c23 commit 7919240

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/client_manager.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Client* ClientManager::create_client(std::unique_ptr<UserInterface>&& ui, int pi
7777
context.window().center_line(init_coord->line);
7878
}
7979

80-
auto(std::move(unlock)); // unlock now
80+
unlock.trigger();
8181

8282
try
8383
{

src/utils.hh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ public:
7272
: m_valid{other.m_valid}, m_func{std::move(other.m_func)}
7373
{ other.m_valid = false; }
7474

75+
[[gnu::always_inline]]
76+
void trigger() { if (m_valid) m_func(); m_valid = false; }
77+
7578
[[gnu::always_inline]]
7679
~OnScopeEnd() noexcept(noexcept(m_func())) { if (m_valid) m_func(); }
7780

0 commit comments

Comments
 (0)