diff options
author | Håvard Pettersen <havardpe@oath.com> | 2020-10-26 15:02:15 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2020-10-26 15:02:15 +0000 |
commit | e821599176a85c58c3fc6d34162bd04045908e79 (patch) | |
tree | a7cd0e19fd226b676ab83e469df5261109f62229 /vespalib | |
parent | 91fef3cdffdfb72917fbe9119ac4a464261e0541 (diff) |
be a bit more strict about uninitialized memory
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/util/stash.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/vespalib/src/vespa/vespalib/util/stash.h b/vespalib/src/vespa/vespalib/util/stash.h index c9a66c1a53f..0186d1e54b9 100644 --- a/vespalib/src/vespa/vespalib/util/stash.h +++ b/vespalib/src/vespa/vespalib/util/stash.h @@ -176,6 +176,7 @@ public: template <typename T> ArrayRef<T> create_uninitialized_array(size_t size) { + static_assert(std::is_trivially_copyable_v<T>); static_assert(can_skip_destruction<T>::value); return ArrayRef<T>(reinterpret_cast<T*>(alloc(size * sizeof(T))), size); } |