From bb82902fd5c4be91852b9c4bc31cee244d07c0b9 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 9 May 2025 14:16:55 -0400 Subject: [PATCH] mon/Monitor: perfect forward universal ref of lambda This method doesn't currently work for std::move of a lambda. Signed-off-by: Patrick Donnelly (cherry picked from commit ff90e0e41784a99579dd12385db7fc0ccf5545a2) --- src/mon/Monitor.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index 016d53ed23d..de15e9ae25f 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -746,10 +746,9 @@ public: ceph::mutex session_map_lock = ceph::make_mutex("Monitor::session_map_lock"); AdminSocketHook *admin_hook; - template - void with_session_map(Func&& func) { + void with_session_map(auto&& f) { std::lock_guard l(session_map_lock); - std::forward(func)(session_map); + std::forward(f)(session_map); } void send_latest_monmap(Connection *con); -- 2.39.5