From ca05c4a3c1e536cdf300b49c49004e4e0e54dfea Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 1 May 2023 20:31:50 +0100 Subject: Don't explictly call destructor of contained element --- lib/pack.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/pack.h b/lib/pack.h index 92c8b20..e63d7cc 100644 --- a/lib/pack.h +++ b/lib/pack.h @@ -33,9 +33,8 @@ public: void erase(typename Container::iterator pos) { - pos->~T(); if (&*pos != &Container::back()) { - new (&*pos) T(std::move(Container::back())); + *pos = std::move(Container::back()); } Container::pop_back(); } -- cgit v1.2.3