[ox/std] Fix more functions to work with UPter custom deleters
This commit is contained in:
parent
9a80196fa6
commit
cc7c7ac9d7
8
deps/ox/src/ox/std/memory.hpp
vendored
8
deps/ox/src/ox/std/memory.hpp
vendored
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user