3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-19 09:40:20 +00:00

remove a few more copy constructors, though still not enough to enable the assertion in vector

I give up for now; there are too many copies left for little return..
This commit is contained in:
Nuno Lopes 2020-06-03 20:30:21 +01:00
parent e2b2b7f82e
commit e844aef896
17 changed files with 44 additions and 95 deletions

View file

@ -191,6 +191,13 @@ public:
push_back(data[i]);
}
void operator=(ref_vector_core && other) {
if (this != &other) {
reset();
m_nodes = std::move(other.m_nodes);
}
}
void swap(unsigned idx1, unsigned idx2) {
std::swap(m_nodes[idx1], m_nodes[idx2]);
}
@ -234,7 +241,7 @@ public:
this->append(other);
}
ref_vector(ref_vector && other) : super(std::move(other)) {}
ref_vector(ref_vector &&) = default;
ref_vector(TManager & m, unsigned sz, T * const * data):
super(ref_manager_wrapper<T, TManager>(m)) {
@ -320,6 +327,11 @@ public:
// prevent abuse:
ref_vector & operator=(ref_vector const & other) = delete;
ref_vector & operator=(ref_vector && other) {
super::operator=(std::move(other));
return *this;
}
bool operator==(ref_vector const& other) const {
if (other.size() != this->size()) return false;
for (unsigned i = this->size(); i-- > 0; ) {