3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-01 12:55:52 +00:00

simplifications to refs

This commit is contained in:
Nuno Lopes 2019-02-19 13:18:20 +00:00
parent 8e4ef19f45
commit edf0df634d
5 changed files with 14 additions and 14 deletions

View file

@ -94,10 +94,8 @@ public:
obj_ref & operator=(obj_ref && n) {
SASSERT(&m_manager == &n.m_manager);
if (this != &n) {
std::swap(m_obj, n.m_obj);
n.reset();
}
std::swap(m_obj, n.m_obj);
n.reset();
return *this;
}

View file

@ -58,6 +58,12 @@ public:
inc_ref(n);
m_buffer.push_back(n);
}
template <typename M>
void push_back(obj_ref<T,M> && n) {
m_buffer.push_back(n.get());
n.steal();
}
void pop_back() {
SASSERT(!m_buffer.empty());

View file

@ -99,8 +99,8 @@ public:
return *this;
}
template <typename W, typename M>
ref_vector_core& push_back(obj_ref<W,M> && n) {
template <typename M>
ref_vector_core& push_back(obj_ref<T,M> && n) {
m_nodes.push_back(n.get());
n.steal();
return *this;