try_call_once overloads
Declared in <folly/synchronization/CallOnce.h>
Grants the free try_call_once access to the flag internals.
bool
try_call_once(
OnceFlag&,
F&&,
Args&&...) noexcept;
» more...
Like call_once, but using a boolean return type to signal pass/fail rather than throwing exceptions.
template<
typename OnceFlag,
typename F,
typename... Args>
[[nodiscard]]
bool
try_call_once(
OnceFlag& flag,
F&& f,
Args&&... args) noexcept;
» more...
true if the flag is now set, otherwise false.
| Name | Description |
|---|---|
| flag | The once-flag guarding the call. |
| f | The callable to invoke at most once; must be noexcept. |
| args | The arguments to forward to the callable. |