]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common: use parameter pack for building future<> 41303/head
authorKefu Chai <kchai@redhat.com>
Wed, 12 May 2021 14:38:15 +0000 (22:38 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 12 May 2021 14:40:05 +0000 (22:40 +0800)
it mirrors the way how seastar::make_ready_future() works. and more
importantly, it allows us to build interruptible_future in the same
way as we build plain seastar::future<> in-place. so we can, for
instance, create a future<tuepl<int,int>> using:

make_ready_future<tuple<int,int>>(1, 2)

instead of using

make_ready_future<tuple<int,int>>(make_tuple(1, 2))

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

index 5c154f2e086e354e9f05693814b68fa639ed2357..e2cb8b541026cd5ebe74b46fe7384fd4515e807f 100644 (file)
@@ -487,15 +487,15 @@ struct interruptible_errorator {
   using future = interruptible_future_detail<InterruptCond,
        typename Errorator::template future<ValueT>>;
 
-  template <typename ValueT = void, typename A>
+  template <typename ValueT = void, typename... A>
   static interruptible_future_detail<
     InterruptCond,
     typename Errorator::template future<ValueT>>
-  make_ready_future(A&& value) {
+  make_ready_future(A&&... value) {
     return interruptible_future_detail<
       InterruptCond, typename Errorator::template future<ValueT>>(
        Errorator::template make_ready_future<ValueT>(
-         std::forward<A>(value)));
+         std::forward<A>(value)...));
   }
   template <typename ValueT = void>
   static interruptible_future_detail<