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

remove a bunch of constructors to avoid copies

still not enough to guarantee that vector::expand doesnt copy (WIP)
This commit is contained in:
Nuno Lopes 2020-06-03 17:09:27 +01:00
parent 98b5abb1d4
commit 7ac2791482
16 changed files with 66 additions and 83 deletions

View file

@ -39,7 +39,7 @@ protected:
}
void expand() {
static_assert(std::is_nothrow_move_constructible<T>::value);
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) {