diff options
author | Chris Robinson <[email protected]> | 2020-01-05 23:17:26 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-01-05 23:17:26 -0800 |
commit | e9ee6dd2396ad48f441878aeeaa4553eed44ce06 (patch) | |
tree | f40470ec008b5a81a3c8d4f4e413eb551cd03ae1 /common/almalloc.h | |
parent | 8338d9e197ce036a756441f9838a379320ff3ced (diff) |
Ensure a pointer is provided for a templated iterator type
Diffstat (limited to 'common/almalloc.h')
-rw-r--r-- | common/almalloc.h | 4 |
1 files changed, 2 insertions, 2 deletions
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; |