diff --git a/include/nvrhi/common/containers.h b/include/nvrhi/common/containers.h index e8f0be0..8aef07a 100644 --- a/include/nvrhi/common/containers.h +++ b/include/nvrhi/common/containers.h @@ -138,12 +138,12 @@ struct static_vector : private std::array if (current_size > new_size) { for (size_type i = new_size; i < current_size; i++) - (data() + i)->~T(); + *(data() + i) = T{}; } else { for (size_type i = current_size; i < new_size; i++) - new (data() + i) T(); + *(data() + i) = T{}; } current_size = new_size;