39template <
typename... Args>
63 std::lock_guard<std::mutex> lock(mutex);
68 callback_copy = callback_fn;
72 callback_copy(std::forward<Args>(args)...);
84 std::lock_guard<std::mutex> lock(mutex);
89 mutable std::mutex mutex;
bool invoke(Args... args)
Calls the wrapped callback, unless it has already been called.
OnceCallback(Callback callback)
Wraps a callback.
bool was_invoked() const
Reports whether the callback has run.
std::function< void(Args...)> Callback
Signature of the wrapped callback.