From df2dadbd0f0ace6e02281c84218537ec2ce5c47f Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Tue, 18 Nov 2025 21:25:44 +0800 Subject: Add overload of string_view for string utils. clean up codes. --- include/cru/base/Guard.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/cru/base/Guard.h') 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(); -- cgit v1.2.3