4#include <promise-cpp/promise.hpp>
11 using std::reference_wrapper<T>::reference_wrapper;
12 using std::reference_wrapper<T>::get;
13 using std::reference_wrapper<T>::operator T&;
61 template <
typename... List>
65 template <
typename... List>
69 template <
typename...>
76 : promise_(std::move(promise))
84 template <
typename... ThenArgs>
91 return promise_.then([func = std::move(func)](ThenArgs... args) {
92 func(UnpackReferenceWrapper<ThenArgs>::unpack(args)...);
98 return promise_.fail(std::forward<
decltype(func)>(func));
102 template <
typename... FailArgs>
109 return promise_.then(std::forward<
decltype(func)>(func));
114 return promise_.fail([func = std::move(func)](FailArgs... args) {
115 func(UnpackReferenceWrapper<FailArgs>::unpack(args)...);
120 template <
typename... ThenArgs,
typename... FailArgs>
129 return promise_.
then([func = std::move(func)](ThenArgs... args) {
130 func(UnpackReferenceWrapper<ThenArgs>::unpack(args)...);
137 return promise_.
fail([func = std::move(func)](FailArgs... args) {
138 func(UnpackReferenceWrapper<FailArgs>::unpack(args)...);
Definition promise_compat.hpp:73
PromiseTypeBindBase(promise::Promise promise)
Definition promise_compat.hpp:75
promise::Promise promise_
Definition promise_compat.hpp:81
virtual ~PromiseTypeBindBase()=default
Definition range_file_body.hpp:18
auto ref(T &thing)
Definition promise_compat.hpp:20
auto cref(T const &thing)
Definition promise_compat.hpp:26
Definition promise_compat.hpp:10
void operator()() const
Definition promise_compat.hpp:15
Definition promise_compat.hpp:67
Definition promise_compat.hpp:63
auto then(auto &&func)
Definition promise_compat.hpp:107
auto fail(std::function< void(typename UnpackReferenceWrapper< FailArgs >::type...)> func)
Definition promise_compat.hpp:112
PromiseTypeBind< PromiseTypeBindThen< ThenArgs... > > fail(std::function< void(typename UnpackReferenceWrapper< FailArgs >::type...)> func)
Definition promise_compat.hpp:135
PromiseTypeBind< PromiseTypeBindFail< FailArgs... > > then(std::function< void(typename UnpackReferenceWrapper< ThenArgs >::type...)> func)
Definition promise_compat.hpp:127
auto then(std::function< void(typename UnpackReferenceWrapper< ThenArgs >::type...)> func)
Definition promise_compat.hpp:89
auto fail(auto &&func)
Definition promise_compat.hpp:96
Definition promise_compat.hpp:70
static T & unpack(PromiseReferenceWrap< T > thing)
Definition promise_compat.hpp:45
T & type
Definition promise_compat.hpp:44
T const & type
Definition promise_compat.hpp:54
static T const & unpack(PromiseReferenceWrap< T const > thing)
Definition promise_compat.hpp:55
Definition promise_compat.hpp:33
T type
Definition promise_compat.hpp:34
static T & unpack(T &thing)
Definition promise_compat.hpp:35