[ox/std] Fix more functions to work with UPter custom deleters

This commit is contained in:
Gary Talent 2023-12-09 01:33:33 -06:00
parent 9a80196fa6
commit cc7c7ac9d7

View File

@ -210,17 +210,17 @@ class UniquePtr {
return m_t; return m_t;
} }
template<typename U> template<typename U, typename UDeleter>
constexpr void reset(UniquePtr<U> &&other = UniquePtr()) { constexpr void reset(UniquePtr<U, UDeleter> &&other = UniquePtr()) {
auto t = m_t; auto t = m_t;
m_t = other.release(); m_t = other.release();
Deleter()(t); Deleter()(t);
} }
constexpr UniquePtr &operator=(const UniquePtr<T> &other) = delete; constexpr UniquePtr &operator=(UniquePtr const&other) = delete;
template<typename U, typename UDeleter> template<typename U, typename UDeleter>
constexpr UniquePtr &operator=(const UniquePtr<U, UDeleter> &other) = delete; constexpr UniquePtr &operator=(UniquePtr<U, UDeleter> const&other) = delete;
constexpr UniquePtr &operator=(UniquePtr<T> &&other) noexcept { constexpr UniquePtr &operator=(UniquePtr<T> &&other) noexcept {
reset(std::move(other)); reset(std::move(other));