mirror of
https://github.com/Z3Prover/z3
synced 2025-05-12 18:24:43 +00:00
buffer: require a move constructor to avoid copies
remove unneded copy constructors from several classes
This commit is contained in:
parent
3d98bccc33
commit
98b5abb1d4
16 changed files with 38 additions and 50 deletions
|
@ -16,8 +16,7 @@ Author:
|
|||
Revision History:
|
||||
|
||||
--*/
|
||||
#ifndef MPZ_H_
|
||||
#define MPZ_H_
|
||||
#pragma once
|
||||
|
||||
#include<string>
|
||||
#include "util/mutex.h"
|
||||
|
@ -104,7 +103,7 @@ public:
|
|||
mpz(int v):m_val(v), m_kind(mpz_small), m_owner(mpz_self), m_ptr(nullptr) {}
|
||||
mpz():m_val(0), m_kind(mpz_small), m_owner(mpz_self), m_ptr(nullptr) {}
|
||||
mpz(mpz_type* ptr): m_val(0), m_kind(mpz_small), m_owner(mpz_ext), m_ptr(ptr) { SASSERT(ptr);}
|
||||
mpz(mpz && other) : m_val(other.m_val), m_kind(mpz_small), m_owner(mpz_self), m_ptr(nullptr) {
|
||||
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;
|
||||
|
@ -734,6 +733,3 @@ typedef mpz_manager<false> unsynch_mpz_manager;
|
|||
typedef _scoped_numeral<unsynch_mpz_manager> scoped_mpz;
|
||||
typedef _scoped_numeral<synch_mpz_manager> scoped_synch_mpz;
|
||||
typedef _scoped_numeral_vector<unsynch_mpz_manager> scoped_mpz_vector;
|
||||
|
||||
#endif /* MPZ_H_ */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue