aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-01-05 23:17:26 -0800
committerChris Robinson <[email protected]>2020-01-05 23:17:26 -0800
commite9ee6dd2396ad48f441878aeeaa4553eed44ce06 (patch)
treef40470ec008b5a81a3c8d4f4e413eb551cd03ae1 /common
parent8338d9e197ce036a756441f9838a379320ff3ced (diff)
Ensure a pointer is provided for a templated iterator type
Diffstat (limited to 'common')
-rw-r--r--common/almalloc.h4
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;