folly::call_once

call_once overloads

Synopses

Declared in <folly/synchronization/CallOnce.h>

Grants the free call_once access to the flag internals.

template<
    typename OnceFlag,
    typename F,
    typename... Args>
void
call_once(
    OnceFlag&,
    F&&,
    Args&&...);
» more...

Drop-in replacement for std::call_once.

template<
    typename OnceFlag,
    typename F,
    typename... Args>
void
call_once(
    OnceFlag& flag,
    F&& f,
    Args&&... args);
» more...

Parameters

NameDescription
flagThe once-flag guarding the call.
fThe callable to invoke at most once.
argsThe arguments to forward to the callable.