3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-19 10:52:02 +00:00

buffer: require a move constructor to avoid copies

remove unneded copy constructors from several classes
This commit is contained in:
Nuno Lopes 2020-06-03 11:57:49 +01:00
parent 3d98bccc33
commit 98b5abb1d4
16 changed files with 38 additions and 50 deletions

View file

@ -228,6 +228,7 @@ interval::interval(v_dependency_manager & m, rational const & val, bool open, bo
}
interval & interval::operator=(interval const & other) {
SASSERT(&m == &other.m);
m_lower = other.m_lower;
m_upper = other.m_upper;
m_lower_open = other.m_lower_open;
@ -237,6 +238,17 @@ interval & interval::operator=(interval const & other) {
return *this;
}
interval & interval::operator=(interval && other) {
SASSERT(&m == &other.m);
m_lower = std::move(other.m_lower);
m_upper = std::move(other.m_upper);
m_lower_open = other.m_lower_open;
m_upper_open = other.m_upper_open;
m_lower_dep = other.m_lower_dep;
m_upper_dep = other.m_upper_dep;
return *this;
}
interval & interval::operator+=(interval const & other) {
m_lower += other.m_lower;
m_upper += other.m_upper;