From 98eb272b18462872d101abb0c3e4b99e541866cc Mon Sep 17 00:00:00 2001 From: postman01 Date: Tue, 25 Jul 2023 07:45:39 +0800 Subject: [PATCH] Fix unique ptr reset() --- ch16/ex16_28_unique_ptr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch16/ex16_28_unique_ptr.h b/ch16/ex16_28_unique_ptr.h index f58efc23..2c11bdea 100644 --- a/ch16/ex16_28_unique_ptr.h +++ b/ch16/ex16_28_unique_ptr.h @@ -45,7 +45,7 @@ template class UniquePtr { void reset(T* q = nullptr) noexcept { - deleter_(q); + deleter_(_ptr); ptr_ = q; }