3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-10-31 19:52:29 +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

@ -105,8 +105,8 @@ public:
mpz(mpz_type* ptr): m_val(0), m_kind(mpz_small), m_owner(mpz_ext), m_ptr(ptr) { SASSERT(ptr);}
mpz(mpz && other) noexcept : m_val(other.m_val), m_kind(mpz_small), m_owner(mpz_self), m_ptr(nullptr) {
std::swap(m_ptr, other.m_ptr);
unsigned o = m_owner; m_owner = other.m_owner; other.m_owner = o;
unsigned k = m_kind; m_kind = other.m_kind; other.m_kind = k;
m_owner = other.m_owner;
m_kind = other.m_kind;
}
void swap(mpz & other) {
std::swap(m_val, other.m_val);