[ox/std] Fix UniquePtr reset to work when copying from a UniquePtr to subclass type
This commit is contained in:
		
							
								
								
									
										3
									
								
								deps/ox/src/ox/std/memory.hpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								deps/ox/src/ox/std/memory.hpp
									
									
									
									
										vendored
									
									
								
							@@ -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);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user