tryEmplaceWith overloads
Synopses
Declared in <folly/Try.h>
Specialization of tryEmplaceWith() for Try<void>.
template<typename Func>
bool
tryEmplaceWith(
Try<void>& t,
Func&& func) noexcept;
Try to in‐place construct a new value from the result of a function.
template<
typename T,
typename Func>
T*
tryEmplaceWith(
Try<T>& t,
Func&& func) noexcept;
Return Value
-
trueiffunc()completed without an exception,falseiffunc()threw an exception. -
A pointer to the newly constructed object if it completed successfully, otherwise
nullptrif the operation completed with an exception.
Parameters
Name |
Description |
t |
The |
func |
The function to invoke. |
Created with MrDocs