From 7b756ce4778a455cf6bcdbd4b8a36d6aa821e54d Mon Sep 17 00:00:00 2001 From: Ludovic 'Archivist' Lagouardette Date: Mon, 31 May 2021 15:40:26 +0200 Subject: [PATCH] fixed stuff for trivially destructibles Also works for fixing base types since they are trivially destructibles. --- include/gp/containers/vector.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/gp/containers/vector.hpp b/include/gp/containers/vector.hpp index 6fc2377..8c15d13 100644 --- a/include/gp/containers/vector.hpp +++ b/include/gp/containers/vector.hpp @@ -88,6 +88,7 @@ namespace gp{ new(ary+i) T(oth[i]); } } else if(sz > oth.sz) { + if constexpr (!std::is_trivially_destructible_v) for(size_t i = oth.sz; i < sz; ++i) { ary[i]->~T(); }