diff options
Diffstat (limited to 'include/cru/base/Guard.h')
| -rw-r--r-- | include/cru/base/Guard.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/cru/base/Guard.h b/include/cru/base/Guard.h index c05bc668..77e48d79 100644 --- a/include/cru/base/Guard.h +++ b/include/cru/base/Guard.h @@ -14,10 +14,10 @@ struct Guard { Guard() = default; explicit Guard(const ExitFunc& f) : on_exit(f) {} explicit Guard(ExitFunc&& f) : on_exit(std::move(f)) {} - Guard(const Guard&) = delete; - Guard(Guard&&) = default; - Guard& operator=(const Guard&) = delete; - Guard& operator=(Guard&&) = default; + + CRU_DELETE_COPY(Guard) + CRU_DEFAULT_MOVE(Guard) + ~Guard() { if (on_exit) { on_exit(); |
