| Index: blimp/common/mandatory_callback.h
|
| diff --git a/blimp/common/mandatory_callback.h b/blimp/common/mandatory_callback.h
|
| index d1871ce48665a7f48aa783d817e32281248805a4..022830936d28b9b215b65adc9c7e7e3499568627 100644
|
| --- a/blimp/common/mandatory_callback.h
|
| +++ b/blimp/common/mandatory_callback.h
|
| @@ -68,6 +68,19 @@ class MandatoryCallback<ReturnType(ArgTypes...)> {
|
| #endif
|
| }
|
|
|
| + // This a overload that handles the case where there are no arguments provided
|
| + template <typename...>
|
| + ReturnType Run() {
|
| + DCHECK(cb_); // Can't be run following std::move.
|
| +
|
| +#if DCHECK_IS_ON()
|
| + DCHECK(!was_run_);
|
| + was_run_ = true;
|
| +#endif
|
| +
|
| + cb_.Run();
|
| + }
|
| +
|
| template <typename... RunArgs>
|
| ReturnType Run(RunArgs... args) {
|
| DCHECK(cb_); // Can't be run following std::move.
|
| @@ -98,6 +111,8 @@ MandatoryCallback<SignatureType> CreateMandatoryCallback(
|
| return MandatoryCallback<SignatureType>(callback);
|
| }
|
|
|
| +using MandatoryClosure = MandatoryCallback<void()>;
|
| +
|
| } // namespace blimp
|
|
|
| #endif // BLIMP_COMMON_MANDATORY_CALLBACK_H_
|
|
|