]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/Monitor: perfect forward universal ref of lambda
authorPatrick Donnelly <pdonnell@ibm.com>
Fri, 9 May 2025 18:16:55 +0000 (14:16 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Mon, 13 Oct 2025 23:59:32 +0000 (19:59 -0400)
This method doesn't currently work for std::move of a lambda.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
(cherry picked from commit ff90e0e41784a99579dd12385db7fc0ccf5545a2)

src/mon/Monitor.h

index e932871854fe06eb584dbf9eefbc5d4bb798fdca..b278dc4e493b425ce66c5d36f4c427680000134b 100644 (file)
@@ -725,10 +725,9 @@ public:
   ceph::mutex session_map_lock = ceph::make_mutex("Monitor::session_map_lock");
   AdminSocketHook *admin_hook;
 
-  template<typename Func, typename...Args>
-  void with_session_map(Func&& func) {
+  void with_session_map(auto&& f) {
     std::lock_guard l(session_map_lock);
-    std::forward<Func>(func)(session_map);
+    std::forward<decltype(f)>(f)(session_map);
   }
   void send_latest_monmap(Connection *con);