From 02bebde186a25f7c0f1c18fcb4a654434f6f3309 Mon Sep 17 00:00:00 2001 From: capitalistspz Date: Fri, 18 Oct 2024 00:02:10 +0100 Subject: [PATCH] `requires` instead of `std::enable_if` --- src/Common/MemPtr.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Common/MemPtr.h b/src/Common/MemPtr.h index d1638218..73fcb3ef 100644 --- a/src/Common/MemPtr.h +++ b/src/Common/MemPtr.h @@ -121,8 +121,8 @@ class MEMPTR : MEMPTRBase return *this; } - template - std::enable_if_t, Q>& operator*() const noexcept + template requires (!std::is_void_v) + Q& operator*() const noexcept { return *GetPtr(); } @@ -132,8 +132,8 @@ class MEMPTR : MEMPTRBase return GetPtr(); } - template - std::enable_if_t, Q>& operator[](int index) noexcept + template requires (!std::is_void_v) + Q& operator[](int index) noexcept { return GetPtr()[index]; }