Просмотр исходного кода

k_scoped_lock: Mark class as [[nodiscard]]

Prevents logic bugs of the kind described in the previous commit from
slipping through.
Lioncash 5 лет назад
Родитель
Сommit
bc30aa8249
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/core/hle/kernel/k_scoped_lock.h

+ 1 - 1
src/core/hle/kernel/k_scoped_lock.h

@@ -20,7 +20,7 @@ concept KLockable = !std::is_reference_v<T> && requires(T & t) {
 };
 };
 
 
 template <typename T>
 template <typename T>
-requires KLockable<T> class KScopedLock {
+requires KLockable<T> class [[nodiscard]] KScopedLock {
 public:
 public:
     explicit KScopedLock(T* l) : lock_ptr(l) {
     explicit KScopedLock(T* l) : lock_ptr(l) {
         this->lock_ptr->Lock();
         this->lock_ptr->Lock();