Specialization of tryEmplaceWith() for Try<void>.
Synopsis
Declared in <folly/Try.h>
template<typename Func>
bool
tryEmplaceWith(
Try<void>& t,
Func&& func) noexcept;
Description
Calls func() and if it doesn't throw an exception then calls t.emplace(). If func() throws then captures the exception in t using t.emplaceException(). Func must be callable with zero parameters and must return void.
Return Value
true if func() completed without an exception, false if func() threw an exception.
Parameters
Name |
Description |
t |
The |
func |
The function to invoke. |
Created with MrDocs