From e9ee6dd2396ad48f441878aeeaa4553eed44ce06 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 5 Jan 2020 23:17:26 -0800 Subject: Ensure a pointer is provided for a templated iterator type --- common/almalloc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/almalloc.h b/common/almalloc.h index 15ec600d..ed6756f3 100644 --- a/common/almalloc.h +++ b/common/almalloc.h @@ -265,8 +265,8 @@ DIAGNOSTIC_POP } FlexArray(index_type size) : mSize{size} - { uninitialized_default_construct_n(mArray, mSize); } - ~FlexArray() { destroy_n(mArray, mSize); } + { if(mSize > 0) uninitialized_default_construct_n(std::addressof(mArray[0]), mSize); } + ~FlexArray() { if(mSize > 0) destroy_n(std::addressof(mArray[0]), mSize); } FlexArray(const FlexArray&) = delete; FlexArray& operator=(const FlexArray&) = delete; -- cgit v1.2.3