16#ifndef ZYPP_ZYPPNG_MONADIC_MTRY_H
17#define ZYPP_ZYPPNG_MONADIC_MTRY_H
25 ,
typename Ret = std::invoke_result_t<F, Args...>
26 ,
typename Exp = expected<Ret, std::exception_ptr>
31 if constexpr ( std::is_same_v<void, Ret> ) {
32 std::invoke(std::forward<F>(
f), std::forward<Args>(args)... );
45 template <
typename Callback>
49 template <
typename ...Args >
51 return mtry( function, std::forward<Args>(args)... );
57 template <
typename Fun>
58 auto mtry ( Fun && function ) {
60 std::forward<Fun>(function)
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
static expected success(ConsParams &&...params)
std::enable_if< std::is_member_pointer< typenamestd::decay< Functor >::type >::value, typenamestd::result_of< Functor &&(Args &&...)>::type >::typ invoke)(Functor &&f, Args &&... args)
auto mtry(Fun &&function)
Exp mtry(F &&f, Args &&...args)
auto operator()(Args &&...args)
#define ZYPP_FWD_CURRENT_EXCPT()
Drops a logline and returns the current Exception as a std::exception_ptr.