try_to_result overloads
Declared in <folly/result/try.h>
Converts a Try<T> to a result<T>, treating empty as an error.
template<typename T>
result<T>
try_to_result(Try<T> t) noexcept(std::is_nothrow_move_constructible_v<T>);
» more...
If t is empty, defaults to returning a UsingUninitializedTry result. Pick your own default via empty_try_with{ { return result<T>{...}; }.
template<
typename T,
typename IfEmpty>
result<T>
try_to_result(
Try<T> t,
IfEmpty if_empty) noexcept(/* see-below */);
» more...
result<T> mirroring t's value or error state.result<T> mirroring t, using if_empty for the empty state.| Name | Description |
|---|---|
| t | The Try to convert. |
| if_empty | Policy that produces a result<T> for the empty state. |