MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / or_else_impl

Function or_else_impl

crates/cpp/test_headers/expected.hpp:2327–2332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2325 std::declval<Exp>().error())),
2326 detail::enable_if_t<!std::is_void<Ret>::value> * = nullptr>
2327constexpr auto or_else_impl(Exp &&exp, F &&f) {
2328 static_assert(detail::is_expected<Ret>::value, "F must return an expected");
2329 return exp.has_value() ? std::forward<Exp>(exp)
2330 : detail::invoke(std::forward<F>(f),
2331 std::forward<Exp>(exp).error());
2332}
2333
2334template <class Exp, class F,
2335 class Ret = decltype(detail::invoke(std::declval<F>(),

Callers 2

or_elseMethod · 0.85

Calls 2

invokeFunction · 0.85
has_valueMethod · 0.45

Tested by

no test coverage detected