diff options
Diffstat (limited to 'include/cru/common/event.hpp')
-rw-r--r-- | include/cru/common/event.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/cru/common/event.hpp b/include/cru/common/event.hpp index 12c0d0cd..33b2e3f6 100644 --- a/include/cru/common/event.hpp +++ b/include/cru/common/event.hpp @@ -183,6 +183,7 @@ struct EventRevokerDestroyer { class EventRevokerGuard { public: + EventRevokerGuard() = default; explicit EventRevokerGuard(EventRevoker&& revoker) : revoker_(new EventRevoker(std::move(revoker))) {} EventRevokerGuard(const EventRevokerGuard& other) = delete; @@ -200,6 +201,10 @@ class EventRevokerGuard { void Release() { revoker_.release(); } + void Reset(EventRevoker&& revoker) { + revoker_.reset(new EventRevoker(std::move(revoker))); + } + private: std::unique_ptr<EventRevoker, details::EventRevokerDestroyer> revoker_; }; // namespace cru |