diff options
-rw-r--r-- | eval/src/vespa/eval/eval/fast_value.hpp | 1 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/util/stash.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/eval/src/vespa/eval/eval/fast_value.hpp b/eval/src/vespa/eval/eval/fast_value.hpp index 05cd7bf0ec3..362a7378830 100644 --- a/eval/src/vespa/eval/eval/fast_value.hpp +++ b/eval/src/vespa/eval/eval/fast_value.hpp @@ -176,6 +176,7 @@ struct FastCells { size(0), memory(malloc(elem_size * capacity)) { + static_assert(std::is_trivially_copyable_v<T>); static_assert(can_skip_destruction<T>::value); } ~FastCells() { 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); } |