aboutsummaryrefslogtreecommitdiffstats
path: root/common/almalloc.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-06-29 18:53:20 -0700
committerChris Robinson <[email protected]>2019-06-29 18:53:20 -0700
commitcbcee69ed14fb23db28bf36ef726a8d0f10d0a40 (patch)
tree1edda77a5a348e4371d07393b699fd8e82270716 /common/almalloc.h
parentc7797fa10fa35e607db61f4a37d0b35761f02e4e (diff)
Add an empty() method to FlexArray
Diffstat (limited to 'common/almalloc.h')
-rw-r--r--common/almalloc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/almalloc.h b/common/almalloc.h
index d649716c..23f9edce 100644
--- a/common/almalloc.h
+++ b/common/almalloc.h
@@ -185,13 +185,13 @@ struct FlexArray {
FlexArray(index_type size) : mSize{size}
{ uninitialized_default_construct_n(mArray, mSize); }
- ~FlexArray()
- { destroy_n(mArray, mSize); }
+ ~FlexArray() { destroy_n(mArray, mSize); }
FlexArray(const FlexArray&) = delete;
FlexArray& operator=(const FlexArray&) = delete;
index_type size() const noexcept { return mSize; }
+ bool empty() const noexcept { return mSize == 0; }
pointer data() noexcept { return mArray; }
const_pointer data() const noexcept { return mArray; }