[ox/std] Fix UniquePtr reset to work when copying from a UniquePtr to subclass type

This commit is contained in:
Gary Talent 2021-10-29 21:40:58 -05:00
parent 31dcd0d280
commit 0133ea30dc

View File

@ -56,8 +56,7 @@ class UniquePtr {
template<typename U> template<typename U>
constexpr void reset(UniquePtr<U> &&other = UniquePtr()) { constexpr void reset(UniquePtr<U> &&other = UniquePtr()) {
auto t = m_t; auto t = m_t;
m_t = other.m_t; m_t = other.release();
other.m_t = nullptr;
Deleter()(t); Deleter()(t);
} }