From 1298051a1af15ca779c459722fdb4ae1c5caad2d Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 8 Dec 2023 22:33:36 -0600 Subject: [PATCH] [ox/std] Give UPter alias the other template parameter of UniquePtr --- deps/ox/src/ox/std/memory.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/deps/ox/src/ox/std/memory.hpp b/deps/ox/src/ox/std/memory.hpp index 94af0371..82543bf6 100644 --- a/deps/ox/src/ox/std/memory.hpp +++ b/deps/ox/src/ox/std/memory.hpp @@ -180,7 +180,7 @@ template class UniquePtr { private: - T *m_t; + T *m_t = nullptr; public: explicit constexpr UniquePtr(T *t = nullptr) noexcept: m_t(t) { @@ -190,8 +190,8 @@ class UniquePtr { constexpr UniquePtr(const UniquePtr&) = delete; - template - constexpr UniquePtr(UniquePtr &&other) noexcept { + template + constexpr UniquePtr(UniquePtr &&other) noexcept { m_t = other.release(); } @@ -219,16 +219,16 @@ class UniquePtr { constexpr UniquePtr &operator=(const UniquePtr &other) = delete; - template - constexpr UniquePtr &operator=(const UniquePtr &other) = delete; + template + constexpr UniquePtr &operator=(const UniquePtr &other) = delete; constexpr UniquePtr &operator=(UniquePtr &&other) noexcept { reset(std::move(other)); return *this; } - template - constexpr UniquePtr &operator=(UniquePtr &&other) noexcept { + template + constexpr UniquePtr &operator=(UniquePtr &&other) noexcept { reset(std::move(other)); return *this; } @@ -247,8 +247,8 @@ class UniquePtr { }; -template -using UPtr = UniquePtr; +template +using UPtr = UniquePtr; template constexpr bool operator==(const UniquePtr &p1, const UniquePtr &p2) noexcept {