diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-18 21:25:44 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-18 21:25:44 +0800 |
| commit | df2dadbd0f0ace6e02281c84218537ec2ce5c47f (patch) | |
| tree | 56a360c16c4ba46658572305d3a444fb30d32272 /include/cru/base/Guard.h | |
| parent | 3648f669cb42cdd9d232d60c8b9715dfbbe5b31a (diff) | |
| download | cru-df2dadbd0f0ace6e02281c84218537ec2ce5c47f.tar.gz cru-df2dadbd0f0ace6e02281c84218537ec2ce5c47f.tar.bz2 cru-df2dadbd0f0ace6e02281c84218537ec2ce5c47f.zip | |
Add overload of string_view for string utils. clean up codes.
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(); |
