From 3a0443c472cbae427a637f73425761c6afced03e Mon Sep 17 00:00:00 2001 From: elsid Date: Fri, 17 Feb 2023 18:54:48 +0100 Subject: [PATCH] Make constexpr Misc::NotNullptr member functions --- components/misc/notnullptr.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/misc/notnullptr.hpp b/components/misc/notnullptr.hpp index a7e02c3614..5b0bd92c14 100644 --- a/components/misc/notnullptr.hpp +++ b/components/misc/notnullptr.hpp @@ -11,7 +11,7 @@ namespace Misc class NotNullPtr { public: - NotNullPtr(T* value) + constexpr NotNullPtr(T* value) noexcept : mValue(value) { assert(mValue != nullptr); @@ -19,11 +19,11 @@ namespace Misc NotNullPtr(std::nullptr_t) = delete; - operator T*() const { return mValue; } + constexpr operator T*() const noexcept { return mValue; } - T* operator->() const { return mValue; } + constexpr T* operator->() const noexcept { return mValue; } - T& operator*() const { return *mValue; } + constexpr T& operator*() const noexcept { return *mValue; } private: T* mValue;