]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/common: add specialization for futurize::invoke(Func, monostate)
authorKefu Chai <kchai@redhat.com>
Mon, 14 Sep 2020 00:36:12 +0000 (08:36 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 14 Sep 2020 01:03:44 +0000 (09:03 +0800)
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 <kchai@redhat.com>
src/crimson/common/errorator.h

index dc36dfc37a0e01c6f5e1b01509e4ba9b11801935..e2c992fad1f42612e99b4259d3a59e63c4e873e8 100644 (file)
@@ -1080,9 +1080,19 @@ struct futurize<Container<::crimson::errorated_future_marker<Values...>>> {
   [[gnu::always_inline]]
   static inline type invoke(Func&& func, FuncArgs&&... args) noexcept {
     try {
-        return func(std::forward<FuncArgs>(args)...);
+      return func(std::forward<FuncArgs>(args)...);
     } catch (...) {
-        return make_exception_future(std::current_exception());
+      return make_exception_future(std::current_exception());
+    }
+  }
+
+  template <class Func>
+  [[gnu::always_inline]]
+  static type invoke(Func&& func, seastar::internal::monostate) noexcept {
+    try {
+      return func();
+    } catch (...) {
+      return make_exception_future(std::current_exception());
     }
   }