3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-19 15:04:42 +00:00

Remove copies (#8583)

This commit is contained in:
Nuno Lopes 2026-02-11 18:14:36 +00:00 committed by GitHub
parent 0da28c6d19
commit 836a76c78a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 38 additions and 51 deletions

View file

@ -29,16 +29,14 @@ namespace nlsat {
public:
scoped_literal_vector(solver & s):m_solver(s) {}
~scoped_literal_vector() { reset(); }
scoped_literal_vector(scoped_literal_vector && other) noexcept = default;
// Move assignment operator
scoped_literal_vector & operator=(scoped_literal_vector && other) noexcept {
if (this != &other) {
SASSERT(&m_solver == &other.m_solver);
reset(); // dec_ref our current literals
m_lits = std::move(other.m_lits); // take ownership of other's literals
// other.m_lits is now empty
m_lits = std::move(other.m_lits);
}
return *this;
}