userver: userver/utils/invoke_with_expected.hpp File Reference
Loading...
Searching...
No Matches
invoke_with_expected.hpp File Reference

Detailed Description

Invoke a callable and return its result or exception in utils::expected.

Definition in file invoke_with_expected.hpp.

Go to the source code of this file.

#include <concepts>
#include <exception>
#include <functional>
#include <type_traits>
#include <utility>
#include <userver/utils/expected.hpp>
This graph shows which files directly or indirectly include this file:

Namespaces

namespace  utils
 General-purpose utilities used across userver libraries.

Functions

template<std::invocable Func>
auto utils::InvokeWithExpected (Func &&func) -> expected< std::decay_t< std::invoke_result_t< Func > >, std::exception_ptr >
 Invoke a callable and return its result or exception in utils::expected.