From: Kefu Chai Date: Sat, 8 Apr 2017 18:42:22 +0000 (+0800) Subject: osdc/Objecter: remove duplicated with_osdmap() template function X-Git-Tag: v12.0.2~83^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f45325672fc91a2cb61dbacbc8e417d0968a46c8;p=ceph.git osdc/Objecter: remove duplicated with_osdmap() template function Signed-off-by: Kefu Chai --- diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 3d2c6b1dab18..9f73ca6a9826 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1951,26 +1951,10 @@ private: // Do not call into something that will try to lock the OSDMap from // here or you will have great woe and misery. - template - auto with_osdmap(Callback&& cb, Args&&...args) -> - typename std::enable_if< - std::is_void< - decltype(cb(const_cast(*osdmap), - std::forward(args)...))>::value, - void>::type { - shared_lock l(rwlock); - std::forward(cb)(const_cast(*osdmap), - std::forward(args)...); - } - template auto with_osdmap(Callback&& cb, Args&&... args) -> - typename std::enable_if< - !std::is_void< - decltype(cb(const_cast(*osdmap), - std::forward(args)...))>::value, - decltype(cb(const_cast(*osdmap), - std::forward(args)...))>::type { + decltype(cb(const_cast(*osdmap), + std::forward(args)...)) { shared_lock l(rwlock); return std::forward(cb)(const_cast(*osdmap), std::forward(args)...);