diff options
author | 杨宇千 <crupest@outlook.com> | 2019-09-17 16:05:17 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-09-17 16:05:17 +0800 |
commit | e8dd10eec26d26c3fb30f2712ccf58ac72edc8a2 (patch) | |
tree | 75293a2bb477fb1872087fab8bfd2c89b6d2051f /include/cru/common/event.hpp | |
parent | 465d89b4207cce929dc8e0b6ac93c3533ba19408 (diff) | |
download | cru-e8dd10eec26d26c3fb30f2712ccf58ac72edc8a2.tar.gz cru-e8dd10eec26d26c3fb30f2712ccf58ac72edc8a2.tar.bz2 cru-e8dd10eec26d26c3fb30f2712ccf58ac72edc8a2.zip |
...
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 |