3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-01-19 16:53:18 +00:00

buffer: require a move constructor to avoid copies

remove unneded copy constructors from several classes
This commit is contained in:
Nuno Lopes 2020-06-03 11:57:49 +01:00
parent 3d98bccc33
commit 98b5abb1d4
16 changed files with 38 additions and 50 deletions

View file

@ -21,7 +21,7 @@ Revision History:
--*/
#pragma once
#include<string.h>
#include <type_traits>
#include "util/memory_manager.h"
template<typename T, bool CallDestructors=true, unsigned INITIAL_SIZE=16>
@ -39,6 +39,7 @@ protected:
}
void expand() {
static_assert(std::is_nothrow_move_constructible<T>::value);
unsigned new_capacity = m_capacity << 1;
T * new_buffer = reinterpret_cast<T*>(memory::allocate(sizeof(T) * new_capacity));
for (unsigned i = 0; i < m_pos; ++i) {