From: Radoslaw Zarzynski Date: Tue, 7 Jul 2020 13:11:07 +0000 (+0200) Subject: crimson/common: implement satisfy_with_result_of() in errorator's futurize. X-Git-Tag: v16.1.0~1424^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6538b34ea47553bd98e3b5217d6298830108ea92;p=ceph.git crimson/common: implement satisfy_with_result_of() in errorator's futurize. This is needed due to the recent changes in `seastar::future`'s implementation. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index 7efc41836776..d6301769394a 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -352,6 +352,14 @@ private: template friend class maybe_handle_error_t; + // any `seastar::futurize` specialization must be able to access the base. + // see : `satisfy_with_result_of()` far below. + template + friend class seastar::futurize; + + template + friend auto seastar::internal::do_with_impl(T1&& rv1, T2&& rv2, More&&... more); + template > struct get_errorator { // generic template for non-errorated things (plain types and @@ -1059,6 +1067,21 @@ struct futurize>> { static type make_exception_future(Arg&& arg) { return errorator_type::template make_exception_future2(std::forward(arg)); } + +private: + template + static void satisfy_with_result_of(PromiseT&& pr, Func&& func) { + // this may use the protected variant of `seastar::future::forward_to()` + // because: + // 1. `seastar::future` established a friendship with with all + // specializations of `seastar::futurize`, including this + // one (we're in the `seastar` namespace!) WHILE + // 2. any errorated future declares now the friendship with any + // `seastar::futurize<...>`. + func().forward_to(std::move(pr)); + } + template + friend class future; }; namespace internal {