[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;
}
template<typename U>
constexpr void reset(UniquePtr<U> &&other = UniquePtr()) {
template<typename U, typename UDeleter>
constexpr void reset(UniquePtr<U, UDeleter> &&other = UniquePtr()) {
auto t = m_t;
m_t = other.release();
Deleter()(t);
}
constexpr UniquePtr &operator=(const UniquePtr<T> &other) = delete;
constexpr UniquePtr &operator=(UniquePtr const&other) = delete;
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 {
reset(std::move(other));