From b1b4f2337e286e2c079634906224fc67ae3ff7c3 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 5 Dec 2020 00:07:00 -0800 Subject: hle: kernel: KScopedLock: Various style fixes based on code review feedback. --- src/core/hle/kernel/k_scoped_lock.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/core/hle') diff --git a/src/core/hle/kernel/k_scoped_lock.h b/src/core/hle/kernel/k_scoped_lock.h index 03320859f..d7cc557b2 100644 --- a/src/core/hle/kernel/k_scoped_lock.h +++ b/src/core/hle/kernel/k_scoped_lock.h @@ -12,7 +12,7 @@ namespace Kernel { template -concept KLockable = !std::is_reference::value && requires(T & t) { +concept KLockable = !std::is_reference_v && requires(T & t) { { t.Lock() } ->std::same_as; { t.Unlock() } @@ -20,11 +20,7 @@ concept KLockable = !std::is_reference::value && requires(T & t) { }; template -requires KLockable class KScopedLock : NonCopyable { - -private: - T* lock_ptr; - +requires KLockable class KScopedLock { public: explicit KScopedLock(T* l) : lock_ptr(l) { this->lock_ptr->Lock(); @@ -34,6 +30,12 @@ public: ~KScopedLock() { this->lock_ptr->Unlock(); } + + KScopedLock(const KScopedLock&) = delete; + KScopedLock(KScopedLock&&) = delete; + +private: + T* lock_ptr; }; } // namespace Kernel -- cgit v1.2.3