mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Make constexpr Misc::NotNullptr member functions
This commit is contained in:
parent
5db11d81fe
commit
3a0443c472
@ -11,7 +11,7 @@ namespace Misc
|
|||||||
class NotNullPtr
|
class NotNullPtr
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NotNullPtr(T* value)
|
constexpr NotNullPtr(T* value) noexcept
|
||||||
: mValue(value)
|
: mValue(value)
|
||||||
{
|
{
|
||||||
assert(mValue != nullptr);
|
assert(mValue != nullptr);
|
||||||
@ -19,11 +19,11 @@ namespace Misc
|
|||||||
|
|
||||||
NotNullPtr(std::nullptr_t) = delete;
|
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:
|
private:
|
||||||
T* mValue;
|
T* mValue;
|
||||||
|
Loading…
Reference in New Issue
Block a user