From 72fd58b8bd2cb1ada80a2a3f85b367228ca7a66c Mon Sep 17 00:00:00 2001 From: _Redstone_c_ Date: Tue, 3 Jan 2023 19:22:06 +0800 Subject: [PATCH] refactor(templates): change the derived class of FNoncopyable to private inheritance --- Redcraft.Utility/Source/Public/Templates/ScopeHelper.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Redcraft.Utility/Source/Public/Templates/ScopeHelper.h b/Redcraft.Utility/Source/Public/Templates/ScopeHelper.h index 83874d8..32a12b1 100644 --- a/Redcraft.Utility/Source/Public/Templates/ScopeHelper.h +++ b/Redcraft.Utility/Source/Public/Templates/ScopeHelper.h @@ -14,7 +14,7 @@ NAMESPACE_MODULE_BEGIN(Utility) /** The class template is a general-purpose scope guard intended to call its callback function when a scope is exited. */ template requires (CDestructible) -class TScopeCallback final : public FNoncopyable +class TScopeCallback final : private FNoncopyable { public: @@ -53,7 +53,7 @@ TScopeCallback(F) -> TScopeCallback; /** The class template is a general-purpose scope guard intended to make sure a value is restored when a scope is exited. */ template requires (CCopyConstructible && CCopyAssignable && CMoveAssignable && CDestructible) -class TGuardValue final : public FNoncopyable +class TGuardValue final : private FNoncopyable { public: @@ -99,7 +99,7 @@ TGuardValue(T&, U&&) -> TGuardValue; /** Commonly used to make sure a value is incremented, and then decremented when a scope is exited. */ template requires (requires(T& Value) { ++Value; --Value; }) -class TScopeCounter : public FNoncopyable +class TScopeCounter final : private FNoncopyable { public: