From f94d5af52cd8db76d3011379e27176466ca10394 Mon Sep 17 00:00:00 2001 From: Willem Jan Withagen Date: Fri, 1 Mar 2019 21:36:26 +0100 Subject: [PATCH] mds: Fix use of auto prototype, it is a non std extension Clang complains: In file included from /home/jenkins/workspace/ceph-master/src/msg/Message.cc:128: In file included from /home/jenkins/workspace/ceph-master/src/messages/MFSMap.h:20: /home/jenkins/workspace/ceph-master/src/mds/FSMap.h:330:49: error: 'auto' not allowed in function prototype void modify_filesystem(fs_cluster_id_t fscid, auto&& fn) ^~~~ /home/jenkins/workspace/ceph-master/src/mds/FSMap.h:341:37: error: 'auto' not allowed in function prototype void modify_daemon(mds_gid_t who, auto&& fn) ^~~~ Signed-off-by: Willem Jan Withagen --- src/mds/FSMap.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mds/FSMap.h b/src/mds/FSMap.h index 36d024c2e36..199b2cf8d14 100644 --- a/src/mds/FSMap.h +++ b/src/mds/FSMap.h @@ -327,7 +327,8 @@ public: * Mutator helper for Filesystem objects: expose a non-const * Filesystem pointer to `fn` and update epochs appropriately. */ - void modify_filesystem(fs_cluster_id_t fscid, auto&& fn) + template + void modify_filesystem(fs_cluster_id_t fscid, T&& fn) { auto& fs = filesystems.at(fscid); fn(fs); @@ -338,7 +339,8 @@ public: * Apply a mutation to the mds_info_t structure for a particular * daemon (identified by GID), and make appropriate updates to epochs. */ - void modify_daemon(mds_gid_t who, auto&& fn) + template + void modify_daemon(mds_gid_t who, T&& fn) { const auto& fscid = mds_roles.at(who); if (fscid == FS_CLUSTER_ID_NONE) { -- 2.39.5