]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common/interruptible_future: ensure seastar::AllAreFutures<> is happy
authorKefu Chai <tchaikov@gmail.com>
Tue, 1 Mar 2022 16:06:07 +0000 (00:06 +0800)
committerKefu Chai <tchaikov@gmail.com>
Tue, 1 Mar 2022 17:11:04 +0000 (01:11 +0800)
if compiled with C++20, C++ concept is enabled. to ensure the
constraints required by when_all_impl() is fulfilled, we need to
specialize is_tuple_of_futures<> for interruptible_future.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/crimson/common/interruptible_future.h

index f5b73a35cf654e565cde0ddfe24a85dbb5477777..d7f09b6dfa086516bdb725030d21d4515ff9023d 100644 (file)
@@ -64,6 +64,18 @@ namespace seastar::internal {
   {};
 }
 
+SEASTAR_CONCEPT(
+namespace crimson::interruptible {
+  template<typename InterruptCond, typename FutureType>
+  class interruptible_future_detail;
+}
+namespace seastar::impl {
+  template <typename InterruptCond, typename FutureType, typename... Rest>
+  struct is_tuple_of_futures<std::tuple<crimson::interruptible::interruptible_future_detail<InterruptCond, FutureType>, Rest...>>
+    : is_tuple_of_futures<std::tuple<Rest...>> {};
+}
+)
+
 namespace crimson::interruptible {
 
 struct ready_future_marker {};