From: Kefu Chai Date: Mon, 14 Sep 2020 00:36:12 +0000 (+0800) Subject: crimson/common: add specialization for futurize::invoke(Func, monostate) X-Git-Tag: v16.1.0~1105^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=47e88cd7c3fcc5c4111dcd39ecb1f98091d8d2fc;p=ceph.git crimson/common: add specialization for futurize::invoke(Func, monostate) this is a leftover of 260a702ba983f1bca29d4c8d1e28f3eef46c6699. where we bumped up the Seastar API level to 5, in which seastar::internal::monostate is used to represent the stored state of a future instead of a tuple<>. to address FTBFS with GCC-9.2.1 Signed-off-by: Kefu Chai --- diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index dc36dfc37a0e..e2c992fad1f4 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -1080,9 +1080,19 @@ struct futurize>> { [[gnu::always_inline]] static inline type invoke(Func&& func, FuncArgs&&... args) noexcept { try { - return func(std::forward(args)...); + return func(std::forward(args)...); } catch (...) { - return make_exception_future(std::current_exception()); + return make_exception_future(std::current_exception()); + } + } + + template + [[gnu::always_inline]] + static type invoke(Func&& func, seastar::internal::monostate) noexcept { + try { + return func(); + } catch (...) { + return make_exception_future(std::current_exception()); } }