From 47e88cd7c3fcc5c4111dcd39ecb1f98091d8d2fc Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 14 Sep 2020 08:36:12 +0800 Subject: [PATCH] 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 --- src/crimson/common/errorator.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index dc36dfc37a0..e2c992fad1f 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()); } } -- 2.39.5