try_to_result overloads
Synopses
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>);
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 */);
Return Value
-
A
result<T>mirroringt's value or error state. -
A
result<T>mirroringt, usingif_emptyfor the empty state.
Parameters
Name |
Description |
t |
The |
if_empty |
Policy that produces a |
Created with MrDocs