3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

remove spurious copies and inc_refs around ref_vector

This commit is contained in:
Nuno Lopes 2018-06-28 10:31:38 +01:00
parent eabe91cdef
commit 5de6628a5d
16 changed files with 49 additions and 53 deletions

View file

@ -99,6 +99,13 @@ public:
return *this;
}
template <typename W, typename M>
ref_vector_core& push_back(obj_ref<W,M> && n) {
m_nodes.push_back(n.get());
n.steal();
return *this;
}
void pop_back() {
SASSERT(!m_nodes.empty());
T * n = m_nodes.back();
@ -253,6 +260,13 @@ public:
return *this;
}
template <typename W, typename M>
element_ref & operator=(obj_ref<W,M> && n) {
m_manager.dec_ref(m_ref);
m_ref = n.steal();
return *this;
}
T * get() const {
return m_ref;
}
@ -288,9 +302,8 @@ public:
return *this;
}
private:
// prevent abuse:
ref_vector & operator=(ref_vector const & other);
ref_vector & operator=(ref_vector const & other) = delete;
};
template<typename T>