]> git-server-git.apps.pok.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>
Wed, 1 Oct 2025 18:46:55 +0000 (14:46 -0400)
This method doesn't currently work for std::move of a lambda.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/mon/Monitor.h

index 016d53ed23d31da1459abf8d052eb8997af1f8cf..de15e9ae25fbe1f1560156e067ca665137681e46 100644 (file)
@@ -746,10 +746,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);