diff --git a/src/ast/recfun_decl_plugin.cpp b/src/ast/recfun_decl_plugin.cpp index 7a3e9521da6..495f3cb2086 100644 --- a/src/ast/recfun_decl_plugin.cpp +++ b/src/ast/recfun_decl_plugin.cpp @@ -602,15 +602,6 @@ namespace recfun { m_args.append(n->get_num_args(), n->get_args()); } - case_expansion::case_expansion(case_expansion const & from) - : m_lhs(from.m_lhs), - m_def(from.m_def), - m_args(from.m_args) {} - case_expansion::case_expansion(case_expansion && from) - : m_lhs(from.m_lhs), - m_def(from.m_def), - m_args(std::move(from.m_args)) {} - std::ostream& case_expansion::display(std::ostream & out) const { return out << "case_exp(" << m_lhs << ")"; } diff --git a/src/ast/recfun_decl_plugin.h b/src/ast/recfun_decl_plugin.h index 442bdadbd0b..3a1dc8e84c1 100644 --- a/src/ast/recfun_decl_plugin.h +++ b/src/ast/recfun_decl_plugin.h @@ -301,8 +301,6 @@ namespace recfun { recfun::def * m_def; expr_ref_vector m_args; case_expansion(recfun::util& u, app * n); - case_expansion(case_expansion const & from); - case_expansion(case_expansion && from); std::ostream& display(std::ostream& out) const; }; @@ -323,10 +321,6 @@ namespace recfun { } body_expansion(app_ref & pred, recfun::case_def const & d, expr_ref_vector & args) : m_pred(pred), m_cdef(&d), m_args(args) {} - body_expansion(body_expansion const & from): - m_pred(from.m_pred), m_cdef(from.m_cdef), m_args(from.m_args) {} - body_expansion(body_expansion && from) noexcept : - m_pred(from.m_pred), m_cdef(from.m_cdef), m_args(std::move(from.m_args)) {} std::ostream& display(std::ostream& out) const; }; diff --git a/src/math/dd/dd_pdd.h b/src/math/dd/dd_pdd.h index 2dc9a948093..fa545c06ec0 100644 --- a/src/math/dd/dd_pdd.h +++ b/src/math/dd/dd_pdd.h @@ -503,7 +503,7 @@ namespace dd { unsigned max_pow2_divisor() const { return m->max_pow2_divisor(root); } unsigned_vector const& free_vars() const { return m->free_vars(*this); } - void swap(pdd& other) { VERIFY_EQ(m, other.m); std::swap(root, other.root); } + void swap(pdd& other) noexcept { VERIFY_EQ(m, other.m); std::swap(root, other.root); } pdd_iterator begin() const; pdd_iterator end() const; @@ -547,7 +547,7 @@ namespace dd { inline pdd& operator-=(pdd & p, rational const& q) { p = p - q; return p; } inline pdd& operator+=(pdd & p, rational const& q) { p = p + q; return p; } - inline void swap(pdd& p, pdd& q) { p.swap(q); } + inline void swap(pdd& p, pdd& q) noexcept { p.swap(q); } std::ostream& operator<<(std::ostream& out, pdd const& b); diff --git a/src/math/lp/lp_core_solver_base.h b/src/math/lp/lp_core_solver_base.h index 099c692c6bc..a5b79e9c8f5 100644 --- a/src/math/lp/lp_core_solver_base.h +++ b/src/math/lp/lp_core_solver_base.h @@ -517,7 +517,7 @@ class lp_core_solver_base { template - static void swap(vector &v, unsigned i, unsigned j) { + static void swap(vector &v, unsigned i, unsigned j) noexcept { auto t = v[i]; v[i] = v[j]; v[j] = t; diff --git a/src/math/polynomial/algebraic_numbers.cpp b/src/math/polynomial/algebraic_numbers.cpp index 1a4769ac334..736d08708ac 100644 --- a/src/math/polynomial/algebraic_numbers.cpp +++ b/src/math/polynomial/algebraic_numbers.cpp @@ -358,7 +358,7 @@ namespace algebraic_numbers { return a.to_algebraic()->m_p_sz - 1; } - void swap(numeral & a, numeral & b) { + void swap(numeral & a, numeral & b) noexcept { std::swap(a.m_cell, b.m_cell); } @@ -2935,7 +2935,7 @@ namespace algebraic_numbers { return m_imp->to_rational(const_cast(a), r); } - void manager::swap(numeral & a, numeral & b) { + void manager::swap(numeral & a, numeral & b) noexcept { return m_imp->swap(a, b); } diff --git a/src/math/polynomial/algebraic_numbers.h b/src/math/polynomial/algebraic_numbers.h index 00af9a7a8a6..63b833b80c8 100644 --- a/src/math/polynomial/algebraic_numbers.h +++ b/src/math/polynomial/algebraic_numbers.h @@ -129,7 +129,7 @@ namespace algebraic_numbers { void set(numeral & a, mpq const & n); void set(numeral & a, numeral const & n); - void swap(numeral & a, numeral & b); + void swap(numeral & a, numeral & b) noexcept; /** \brief Store in b an integer value smaller than 'a'. diff --git a/src/math/polynomial/polynomial.cpp b/src/math/polynomial/polynomial.cpp index a352d1d37a0..dde4a5f80e8 100644 --- a/src/math/polynomial/polynomial.cpp +++ b/src/math/polynomial/polynomial.cpp @@ -447,7 +447,7 @@ namespace polynomial { } }; - inline void swap(monomial * & m1, monomial * & m2) { std::swap(m1, m2); } + inline void swap(monomial * & m1, monomial * & m2) noexcept { std::swap(m1, m2); } typedef chashtable monomial_table; diff --git a/src/math/polynomial/upolynomial.cpp b/src/math/polynomial/upolynomial.cpp index ac0aec8ef5f..a354ed2951b 100644 --- a/src/math/polynomial/upolynomial.cpp +++ b/src/math/polynomial/upolynomial.cpp @@ -126,7 +126,7 @@ namespace upolynomial { m_factors[i].swap(p); } - void core_manager::factors::swap(factors & other) { + void core_manager::factors::swap(factors & other) noexcept { m_factors.swap(other.m_factors); m_degrees.swap(other.m_degrees); nm().swap(m_constant, other.m_constant); diff --git a/src/math/polynomial/upolynomial.h b/src/math/polynomial/upolynomial.h index faa0e5e0983..2afdbb7b3d1 100644 --- a/src/math/polynomial/upolynomial.h +++ b/src/math/polynomial/upolynomial.h @@ -89,7 +89,7 @@ namespace upolynomial { void push_back_swap(numeral_vector & p, unsigned degree); void swap_factor(unsigned i, numeral_vector & p); - void swap(factors & other); + void swap(factors & other) noexcept; void multiply(numeral_vector & out) const; void display(std::ostream & out) const; diff --git a/src/math/polynomial/upolynomial_factorization_int.h b/src/math/polynomial/upolynomial_factorization_int.h index e66fd2f1ba1..a65e5ee62f7 100644 --- a/src/math/polynomial/upolynomial_factorization_int.h +++ b/src/math/polynomial/upolynomial_factorization_int.h @@ -85,7 +85,7 @@ namespace upolynomial { unsigned max_degree() const { return m_set.size() - 1; } - void swap(factorization_degree_set & other) { + void swap(factorization_degree_set & other) noexcept { m_set.swap(other.m_set); } diff --git a/src/math/realclosure/mpz_matrix.h b/src/math/realclosure/mpz_matrix.h index 878fb72f912..91fe226816b 100644 --- a/src/math/realclosure/mpz_matrix.h +++ b/src/math/realclosure/mpz_matrix.h @@ -50,7 +50,7 @@ class mpz_matrix { SASSERT(j < n); return a_ij[i*n + j]; } mpz & operator()(unsigned i, unsigned j) { SASSERT(i < m); SASSERT(j < n); return a_ij[i*n + j]; } - void swap(mpz_matrix & B) { std::swap(m, B.m); std::swap(n, B.n); std::swap(a_ij, B.a_ij); } + void swap(mpz_matrix & B) noexcept { std::swap(m, B.m); std::swap(n, B.n); std::swap(a_ij, B.a_ij); } mpz * row(unsigned i) const { SASSERT(i < m); return a_ij + i*n; } }; @@ -136,7 +136,7 @@ class scoped_mpz_matrix { mpz_matrix const & get() const { return A; } mpz_matrix & get() { return A; } - void swap(mpz_matrix & B) { A.swap(B); } + void swap(mpz_matrix & B) noexcept { A.swap(B); } void set(unsigned i, unsigned j, mpz const & v) { nm().set(A(i, j), v); } void set(unsigned i, unsigned j, int v) { nm().set(A(i, j), v); } diff --git a/src/math/realclosure/realclosure.cpp b/src/math/realclosure/realclosure.cpp index d179ec575e5..ecea560a515 100644 --- a/src/math/realclosure/realclosure.cpp +++ b/src/math/realclosure/realclosure.cpp @@ -135,7 +135,7 @@ namespace realclosure { typedef interval_manager mpbqi_manager; typedef mpbqi_manager::interval mpbqi; - void swap(mpbqi & a, mpbqi & b) { + void swap(mpbqi & a, mpbqi & b) noexcept { swap(a.m_lower, b.m_lower); swap(a.m_upper, b.m_upper); std::swap(a.m_lower_inf, b.m_lower_inf); @@ -2534,7 +2534,7 @@ namespace realclosure { return depends_on_infinitesimals(a.m_value); } - static void swap(mpbqi & a, mpbqi & b) { + static void swap(mpbqi & a, mpbqi & b) noexcept { realclosure::swap(a, b); } @@ -6313,7 +6313,7 @@ namespace realclosure { m_imp->set(a, n); } - void manager::swap(numeral & a, numeral & b) { + void manager::swap(numeral & a, numeral & b) noexcept { std::swap(a.m_value, b.m_value); } diff --git a/src/math/realclosure/realclosure.h b/src/math/realclosure/realclosure.h index f63b43a5ded..12247627bb5 100644 --- a/src/math/realclosure/realclosure.h +++ b/src/math/realclosure/realclosure.h @@ -164,7 +164,7 @@ namespace realclosure { void set(numeral & a, mpq const & n); void set(numeral & a, numeral const & n); - void swap(numeral & a, numeral & b); + void swap(numeral & a, numeral & b) noexcept; /** \brief Return a^{1/k} diff --git a/src/muz/rel/dl_base.h b/src/muz/rel/dl_base.h index f6d03162423..158df4906ff 100644 --- a/src/muz/rel/dl_base.h +++ b/src/muz/rel/dl_base.h @@ -484,7 +484,7 @@ namespace datalog { virtual bool can_swap(const base_object & o) const { return false; } - virtual void swap(base_object & o) { + virtual void swap(base_object & o) noexcept { std::swap(m_kind, o.m_kind); #if DL_LEAK_HUNTING m_leak_guard = get_plugin().get_ast_manager().mk_fresh_sort(get_plugin().get_name().bare_str()); @@ -910,7 +910,7 @@ namespace datalog { public: table_signature() : m_functional_columns(0) {} - void swap(table_signature & s) { + void swap(table_signature & s) noexcept { signature_base::swap(s); std::swap(m_functional_columns, s.m_functional_columns); } diff --git a/src/muz/rel/dl_finite_product_relation.cpp b/src/muz/rel/dl_finite_product_relation.cpp index b1cdf055356..293cc72e2e0 100644 --- a/src/muz/rel/dl_finite_product_relation.cpp +++ b/src/muz/rel/dl_finite_product_relation.cpp @@ -1835,7 +1835,7 @@ namespace datalog { } } - void finite_product_relation::swap(relation_base & r0) { + void finite_product_relation::swap(relation_base & r0) noexcept { SASSERT(can_swap(r0)); finite_product_relation & r = finite_product_relation_plugin::get(r0); SASSERT(get_signature()==r.get_signature()); diff --git a/src/muz/rel/dl_finite_product_relation.h b/src/muz/rel/dl_finite_product_relation.h index f1387437b83..324564469f2 100644 --- a/src/muz/rel/dl_finite_product_relation.h +++ b/src/muz/rel/dl_finite_product_relation.h @@ -316,7 +316,7 @@ namespace datalog { Both relations must come from the same plugin and be of the same signature. */ - void swap(relation_base & r) override; + void swap(relation_base & r) noexcept override; /** \brief Create a \c finite_product_relation object. diff --git a/src/muz/rel/dl_vector_relation.h b/src/muz/rel/dl_vector_relation.h index ad9204b4105..e61fc5a2ae8 100644 --- a/src/muz/rel/dl_vector_relation.h +++ b/src/muz/rel/dl_vector_relation.h @@ -59,7 +59,7 @@ namespace datalog { dealloc(m_elems); } - void swap(relation_base& other) override { + void swap(relation_base& other) noexcept override { vector_relation& o = dynamic_cast(other); if (&o == this) return; std::swap(o.m_eqs, m_eqs); diff --git a/src/nlsat/nlsat_assignment.h b/src/nlsat/nlsat_assignment.h index 6729b73cd82..d96c8099e91 100644 --- a/src/nlsat/nlsat_assignment.h +++ b/src/nlsat/nlsat_assignment.h @@ -33,7 +33,7 @@ namespace nlsat { public: assignment(anum_manager & _m):m_values(_m) {} anum_manager & am() const { return m_values.m(); } - void swap(assignment & other) { + void swap(assignment & other) noexcept { m_values.swap(other.m_values); m_assigned.swap(other.m_assigned); } @@ -67,7 +67,7 @@ namespace nlsat { anum_manager & m() const override { return am(); } bool contains(var x) const override { return is_assigned(x); } anum const & operator()(var x) const override { SASSERT(is_assigned(x)); return value(x); } - void swap(var x, var y) { + void swap(var x, var y) noexcept { SASSERT(x < m_values.size() && y < m_values.size()); std::swap(m_assigned[x], m_assigned[y]); std::swap(m_values[x], m_values[y]); diff --git a/src/nlsat/nlsat_scoped_literal_vector.h b/src/nlsat/nlsat_scoped_literal_vector.h index a2b617e559c..9b4b62fe8b0 100644 --- a/src/nlsat/nlsat_scoped_literal_vector.h +++ b/src/nlsat/nlsat_scoped_literal_vector.h @@ -67,7 +67,7 @@ namespace nlsat { void append(scoped_literal_vector const& ls) { append(ls.size(), ls.data()); } - void swap(scoped_literal_vector& other) { + void swap(scoped_literal_vector& other) noexcept { SASSERT(&m_solver == &other.m_solver); m_lits.swap(other.m_lits); } diff --git a/src/nlsat/nlsat_solver.cpp b/src/nlsat/nlsat_solver.cpp index 8993182a2b2..40bdd10d634 100644 --- a/src/nlsat/nlsat_solver.cpp +++ b/src/nlsat/nlsat_solver.cpp @@ -48,7 +48,7 @@ namespace nlsat { typedef chashtable root_atom_table; // for apply_permutation procedure - void swap(clause * & c1, clause * & c2) { + void swap(clause * & c1, clause * & c2) noexcept { std::swap(c1, c2); } diff --git a/src/sat/sat_cutset.h b/src/sat/sat_cutset.h index cb97c41d47c..f8451d4123c 100644 --- a/src/sat/sat_cutset.h +++ b/src/sat/sat_cutset.h @@ -183,7 +183,7 @@ namespace sat { void reset(on_update_t& on_del) { shrink(on_del, 0); } cut const & operator[](unsigned idx) const { return m_cuts[idx]; } void shrink(on_update_t& on_del, unsigned j); - void swap(cut_set& other) { + void swap(cut_set& other) noexcept { std::swap(m_var, other.m_var); std::swap(m_size, other.m_size); std::swap(m_max_size, other.m_max_size); diff --git a/src/sat/sat_model_converter.cpp b/src/sat/sat_model_converter.cpp index 27cc6823a36..ddb277e9b23 100644 --- a/src/sat/sat_model_converter.cpp +++ b/src/sat/sat_model_converter.cpp @@ -369,7 +369,7 @@ namespace sat { return result; } - void model_converter::swap(bool_var v, unsigned sz, literal_vector& clause) { + void model_converter::swap(bool_var v, unsigned sz, literal_vector& clause) noexcept { for (unsigned j = 0; j < sz; ++j) { if (v == clause[j].var()) { std::swap(clause[0], clause[j]); diff --git a/src/sat/sat_model_converter.h b/src/sat/sat_model_converter.h index 8a3891797d3..a331bef8e57 100644 --- a/src/sat/sat_model_converter.h +++ b/src/sat/sat_model_converter.h @@ -91,7 +91,7 @@ namespace sat { bool legal_to_flip(bool_var v) const; - void swap(bool_var v, unsigned sz, literal_vector& clause); + void swap(bool_var v, unsigned sz, literal_vector& clause) noexcept; void add_elim_stack(entry & e); diff --git a/src/sat/smt/pb_card.h b/src/sat/smt/pb_card.h index 6df50d81c2b..26c6d3bb1a4 100644 --- a/src/sat/smt/pb_card.h +++ b/src/sat/smt/pb_card.h @@ -33,7 +33,7 @@ namespace pb { literal const* begin() const { return m_lits; } literal const* end() const { return static_cast(m_lits) + m_size; } void negate() override; - void swap(unsigned i, unsigned j) override { std::swap(m_lits[i], m_lits[j]); } + void swap(unsigned i, unsigned j) noexcept override { std::swap(m_lits[i], m_lits[j]); } literal_vector literals() const override { return literal_vector(m_size, m_lits); } bool is_watching(literal l) const override; literal get_lit(unsigned i) const override { return m_lits[i]; } diff --git a/src/sat/smt/pb_constraint.h b/src/sat/smt/pb_constraint.h index d8cec6de9d7..26c5f8b0886 100644 --- a/src/sat/smt/pb_constraint.h +++ b/src/sat/smt/pb_constraint.h @@ -102,7 +102,7 @@ namespace pb { virtual bool is_watching(literal l) const { UNREACHABLE(); return false; }; virtual literal_vector literals() const { UNREACHABLE(); return literal_vector(); } - virtual void swap(unsigned i, unsigned j) { UNREACHABLE(); } + virtual void swap(unsigned i, unsigned j) noexcept { UNREACHABLE(); } virtual literal get_lit(unsigned i) const { UNREACHABLE(); return sat::null_literal; } virtual void set_lit(unsigned i, literal l) { UNREACHABLE(); } virtual void negate() { UNREACHABLE(); } diff --git a/src/sat/smt/pb_pb.h b/src/sat/smt/pb_pb.h index 5db177d0797..169fe247919 100644 --- a/src/sat/smt/pb_pb.h +++ b/src/sat/smt/pb_pb.h @@ -46,7 +46,7 @@ namespace pb { bool is_cardinality() const; void negate() override; void set_k(unsigned k) override { m_k = k; VERIFY(k < 4000000000); update_max_sum(); } - void swap(unsigned i, unsigned j) override { std::swap(m_wlits[i], m_wlits[j]); } + void swap(unsigned i, unsigned j) noexcept override { std::swap(m_wlits[i], m_wlits[j]); } literal_vector literals() const override { literal_vector lits; for (auto wl : *this) lits.push_back(wl.second); return lits; } bool is_watching(literal l) const override; literal get_lit(unsigned i) const override { return m_wlits[i].second; } diff --git a/src/smt/old_interval.cpp b/src/smt/old_interval.cpp index e719f7e2bd8..c4d49d00a59 100644 --- a/src/smt/old_interval.cpp +++ b/src/smt/old_interval.cpp @@ -238,7 +238,7 @@ interval & interval::operator=(interval const & other) { return *this; } -interval & interval::operator=(interval && other) { +interval & interval::operator=(interval && other) noexcept { SASSERT(&m_manager == &other.m_manager); m_lower = std::move(other.m_lower); m_upper = std::move(other.m_upper); diff --git a/src/smt/old_interval.h b/src/smt/old_interval.h index 7a6f41e269f..bf68a0d2665 100644 --- a/src/smt/old_interval.h +++ b/src/smt/old_interval.h @@ -92,7 +92,7 @@ class old_interval { rational const & get_lower_value() const { SASSERT(!minus_infinity()); return m_lower.to_rational(); } rational const & get_upper_value() const { SASSERT(!plus_infinity()); return m_upper.to_rational(); } old_interval & operator=(old_interval const & other); - old_interval & operator=(old_interval && other); + old_interval & operator=(old_interval && other) noexcept; old_interval & operator+=(old_interval const & other); old_interval & operator-=(old_interval const & other); old_interval & operator*=(old_interval const & other); diff --git a/src/util/array.h b/src/util/array.h index a4c2aa2c7b0..2954035f641 100644 --- a/src/util/array.h +++ b/src/util/array.h @@ -184,7 +184,7 @@ class array { T const * data() const { return m_data; } T * data() { return m_data; } - void swap(array & other) { + void swap(array & other) noexcept { std::swap(m_data, other.m_data); } diff --git a/src/util/basic_interval.h b/src/util/basic_interval.h index ca5868b8817..ea35259a036 100644 --- a/src/util/basic_interval.h +++ b/src/util/basic_interval.h @@ -52,8 +52,8 @@ class basic_interval_manager { interval const & get() const { return m_interval; } interval & get() { return m_interval; } void reset() { m().reset(m_interval); } - void swap(scoped_interval & a) { m().swap(m_interval, a.m_interval); } - void swap(interval & a) { m().swap(m_interval, a); } + void swap(scoped_interval & a) noexcept { m().swap(m_interval, a.m_interval); } + void swap(interval & a) noexcept { m().swap(m_interval, a); } bound const & lower() const { return m_interval.lower(); } bound const & upper() const { return m_interval.upper(); } bound & lower() { return m_interval.lower(); } @@ -146,7 +146,7 @@ class basic_interval_manager { m().set(a.m_upper, n); } - void swap(interval & a, interval & b) { + void swap(interval & a, interval & b) noexcept { m().swap(a.m_lower, b.m_lower); m().swap(a.m_upper, b.m_upper); } diff --git a/src/util/bit_vector.h b/src/util/bit_vector.h index cb29bdd9cc6..12f86dd0084 100644 --- a/src/util/bit_vector.h +++ b/src/util/bit_vector.h @@ -98,7 +98,7 @@ class bit_vector { m_num_bits = 0; } - void swap(bit_vector & other) { + void swap(bit_vector & other) noexcept { std::swap(m_data, other.m_data); std::swap(m_num_bits, other.m_num_bits); std::swap(m_capacity, other.m_capacity); diff --git a/src/util/chashtable.h b/src/util/chashtable.h index 3a2d2685b71..450d2bfa454 100644 --- a/src/util/chashtable.h +++ b/src/util/chashtable.h @@ -553,7 +553,7 @@ class chashtable : private HashProc, private EqProc { iterator begin() const { return iterator(m_table, m_table + m_slots); } iterator end() const { return iterator(); } - void swap(chashtable & other) { + void swap(chashtable & other) noexcept { std::swap(m_table, other.m_table); std::swap(m_capacity, other.m_capacity); std::swap(m_init_slots, other.m_init_slots); diff --git a/src/util/double_manager.h b/src/util/double_manager.h index 6bd691d2420..c2189458220 100644 --- a/src/util/double_manager.h +++ b/src/util/double_manager.h @@ -76,7 +76,7 @@ class double_manager { static void set(double & a, unsigned val) { a = static_cast(val); } static void set(double & a, int64_t val) { a = static_cast(val); } static void set(double & a, uint64_t val) { a = static_cast(val); } - static void swap(double & a, double & b) { std::swap(a, b); } + static void swap(double & a, double & b) noexcept { std::swap(a, b); } bool is_pos(double a) const { return a > m_zero_tolerance; } bool is_neg(double a) const { return a < m_zero_tolerance; } bool is_zero(double a) const { return -m_zero_tolerance <= a && a <= m_zero_tolerance; } diff --git a/src/util/f2n.h b/src/util/f2n.h index 2b6c9799a31..e94c21ce26d 100644 --- a/src/util/f2n.h +++ b/src/util/f2n.h @@ -45,7 +45,7 @@ class f2n { m_manager.set(m_one, ebits, sbits, 1); } - f2n(f2n && other) : m_manager(other.m_manager), m_mode(other.m_mode), m_ebits(other.m_ebits), m_sbits(other.m_sbits), + f2n(f2n && other) noexcept : m_manager(other.m_manager), m_mode(other.m_mode), m_ebits(other.m_ebits), m_sbits(other.m_sbits), m_tmp1(std::move(other.m_tmp1)), m_one(std::move(other.m_one)) {} ~f2n() { @@ -86,7 +86,7 @@ class f2n { void set(numeral & o, numeral const & x) { m().set(o, x); check(o); } void set(numeral & o, mpq const & x) { m().set(o, m_ebits, m_sbits, m_mode, x); check(o); } void reset(numeral & o) { m().reset(o, m_ebits, m_sbits); } - static void swap(numeral & x, numeral & y) { x.swap(y); } + static void swap(numeral & x, numeral & y) noexcept { x.swap(y); } void add(numeral const & x, numeral const & y, numeral & o) { m().add(m_mode, x, y, o); check(o); } void sub(numeral const & x, numeral const & y, numeral & o) { m().sub(m_mode, x, y, o); check(o); } diff --git a/src/util/hashtable.h b/src/util/hashtable.h index cfe4d20cabf..b2830326bc4 100644 --- a/src/util/hashtable.h +++ b/src/util/hashtable.h @@ -283,7 +283,7 @@ class core_hashtable : private HashProc, private EqProc { delete_table(); } - void swap(core_hashtable & source) { + void swap(core_hashtable & source) noexcept { std::swap(m_table, source.m_table); std::swap(m_capacity, source.m_capacity); std::swap(m_size, source.m_size); diff --git a/src/util/heap.h b/src/util/heap.h index 332f4e53ec6..c080c6ebde9 100644 --- a/src/util/heap.h +++ b/src/util/heap.h @@ -259,7 +259,7 @@ class heap : private LT { return m_values.end(); } - void swap(heap & other) { + void swap(heap & other) noexcept { if (this != &other) { CASSERT("heap", other.check_invariant()); CASSERT("heap", check_invariant()); diff --git a/src/util/hwf.h b/src/util/hwf.h index 4e1081ebf0d..209a8fe77a9 100644 --- a/src/util/hwf.h +++ b/src/util/hwf.h @@ -35,7 +35,7 @@ class hwf { } public: - void swap(hwf & other) { std::swap(value, other.value); } + void swap(hwf & other) noexcept { std::swap(value, other.value); } }; diff --git a/src/util/inf_eps_rational.h b/src/util/inf_eps_rational.h index b28a6d794cd..ea7ec52fcc6 100644 --- a/src/util/inf_eps_rational.h +++ b/src/util/inf_eps_rational.h @@ -38,7 +38,7 @@ class inf_eps_rational { struct eq_proc { bool operator()(inf_eps_rational const& r1, inf_eps_rational const& r2) const { return r1 == r2; } }; - void swap(inf_eps_rational & n) { + void swap(inf_eps_rational & n) noexcept { m_infty.swap(n.m_infty); m_r.swap(n.m_r); } diff --git a/src/util/inf_int_rational.h b/src/util/inf_int_rational.h index 458843cb037..2025af319f7 100644 --- a/src/util/inf_int_rational.h +++ b/src/util/inf_int_rational.h @@ -43,7 +43,7 @@ class inf_int_rational { struct eq_proc { bool operator()(inf_int_rational const& r1, inf_int_rational const& r2) const { return r1 == r2; } }; - void swap(inf_int_rational & n) { + void swap(inf_int_rational & n) noexcept { m_first.swap(n.m_first); std::swap(m_second, n.m_second); } diff --git a/src/util/inf_rational.h b/src/util/inf_rational.h index fb8a71e5f9a..2d7963ff080 100644 --- a/src/util/inf_rational.h +++ b/src/util/inf_rational.h @@ -44,7 +44,7 @@ class inf_rational { struct eq_proc { bool operator()(inf_rational const& r1, inf_rational const& r2) const { return r1 == r2; } }; - void swap(inf_rational & n) { + void swap(inf_rational & n) noexcept { m_first.swap(n.m_first); m_second.swap(n.m_second); } diff --git a/src/util/inf_s_integer.h b/src/util/inf_s_integer.h index b99167b3261..a02ba70fda9 100644 --- a/src/util/inf_s_integer.h +++ b/src/util/inf_s_integer.h @@ -37,7 +37,7 @@ class inf_s_integer { struct eq_proc { bool operator()(inf_s_integer const& r1, inf_s_integer const& r2) const { return r1 == r2; } }; - void swap(inf_s_integer & n) { + void swap(inf_s_integer & n) noexcept { std::swap(m_first, n.m_first); std::swap(m_second, n.m_second); } diff --git a/src/util/map.h b/src/util/map.h index e9880e0a074..0068be31b1b 100644 --- a/src/util/map.h +++ b/src/util/map.h @@ -184,7 +184,7 @@ class table2map { unsigned long long get_num_collision() const { return m_table.get_num_collision(); } - void swap(table2map & other) { + void swap(table2map & other) noexcept { m_table.swap(other.m_table); } diff --git a/src/util/mpbq.h b/src/util/mpbq.h index 13cd6ae0c5f..edd864dc3e2 100644 --- a/src/util/mpbq.h +++ b/src/util/mpbq.h @@ -40,10 +40,10 @@ class mpbq { mpbq(int v, unsigned k):m_num(v), m_k(k) {} mpz const & numerator() const { return m_num; } unsigned k() const { return m_k; } - void swap(mpbq & other) { m_num.swap(other.m_num); std::swap(m_k, other.m_k); } + void swap(mpbq & other) noexcept { m_num.swap(other.m_num); std::swap(m_k, other.m_k); } }; -inline void swap(mpbq & m1, mpbq & m2) { m1.swap(m2); } +inline void swap(mpbq & m1, mpbq & m2) noexcept { m1.swap(m2); } typedef svector mpbq_vector; @@ -72,7 +72,7 @@ class mpbq_manager { mpbq_manager(unsynch_mpz_manager & m); ~mpbq_manager(); - static void swap(mpbq & a, mpbq & b) { a.swap(b); } + static void swap(mpbq & a, mpbq & b) noexcept { a.swap(b); } void del(mpbq & a) { m_manager.del(a.m_num); } void reset(mpbq & a) { m_manager.reset(a.m_num); a.m_k = 0; } diff --git a/src/util/mpf.cpp b/src/util/mpf.cpp index 605b12aab7a..da0e10571a0 100644 --- a/src/util/mpf.cpp +++ b/src/util/mpf.cpp @@ -41,7 +41,7 @@ mpf::mpf(unsigned _ebits, unsigned _sbits): set(ebits, sbits); } -void mpf::swap(mpf & other) { +void mpf::swap(mpf & other) noexcept { unsigned tmp = ebits; ebits = other.ebits; other.ebits = tmp; diff --git a/src/util/mpf.h b/src/util/mpf.h index 2c3e528d35a..b979e78c1e9 100644 --- a/src/util/mpf.h +++ b/src/util/mpf.h @@ -52,7 +52,7 @@ class mpf { mpf & operator=(mpf const & other) = delete; unsigned get_ebits() const { return ebits; } unsigned get_sbits() const { return sbits; } - void swap(mpf & other); + void swap(mpf & other) noexcept; }; class mpf_manager { @@ -87,7 +87,7 @@ class mpf_manager { void neg(mpf & o); void neg(mpf const & x, mpf & o); - void swap(mpf& a, mpf& b) { a.swap(b); } + void swap(mpf& a, mpf& b) noexcept { a.swap(b); } bool is_zero(mpf const & x); bool is_neg(mpf const & x); diff --git a/src/util/mpff.h b/src/util/mpff.h index c9012a2d053..254c52572c5 100644 --- a/src/util/mpff.h +++ b/src/util/mpff.h @@ -44,14 +44,14 @@ class mpff { m_exponent(0) { } - void swap(mpff & other) { + void swap(mpff & other) noexcept { unsigned sign = m_sign; m_sign = other.m_sign; other.m_sign = sign; unsigned sig_idx = m_sig_idx; m_sig_idx = other.m_sig_idx; other.m_sig_idx = sig_idx; std::swap(m_exponent, other.m_exponent); } }; -inline void swap(mpff & m1, mpff & m2) { m1.swap(m2); } +inline void swap(mpff & m1, mpff & m2) noexcept { m1.swap(m2); } class mpz; class mpq; @@ -316,7 +316,7 @@ class mpff_manager { */ static void abs(mpff & a) { a.m_sign = 0; } - static void swap(mpff & a, mpff & b) { a.swap(b); } + static void swap(mpff & a, mpff & b) noexcept { a.swap(b); } /** \brief c <- a + b diff --git a/src/util/mpfx.h b/src/util/mpfx.h index 7f34e7dc1b5..c563c287232 100644 --- a/src/util/mpfx.h +++ b/src/util/mpfx.h @@ -38,13 +38,13 @@ class mpfx { m_sig_idx(0) { } - void swap(mpfx & other) { + void swap(mpfx & other) noexcept { unsigned sign = m_sign; m_sign = other.m_sign; other.m_sign = sign; unsigned sig_idx = m_sig_idx; m_sig_idx = other.m_sig_idx; other.m_sig_idx = sig_idx; } }; -inline void swap(mpfx & m1, mpfx & m2) { m1.swap(m2); } +inline void swap(mpfx & m1, mpfx & m2) noexcept { m1.swap(m2); } class mpz; class mpq; @@ -228,7 +228,7 @@ class mpfx_manager { */ static void abs(mpfx & a) { a.m_sign = 0; } - static void swap(mpfx & a, mpfx & b) { a.swap(b); } + static void swap(mpfx & a, mpfx & b) noexcept { a.swap(b); } /** \brief c <- a + b diff --git a/src/util/mpq.h b/src/util/mpq.h index 1bdf8f31bce..fa6e8ec756f 100644 --- a/src/util/mpq.h +++ b/src/util/mpq.h @@ -761,9 +761,9 @@ class mpq_manager : public mpz_manager { return temp; } - void swap(mpz & a, mpz & b) { mpz_manager::swap(a, b); } + void swap(mpz & a, mpz & b) noexcept { mpz_manager::swap(a, b); } - void swap(mpq & a, mpq & b) { + void swap(mpq & a, mpq & b) noexcept { swap(a.m_num, b.m_num); swap(a.m_den, b.m_den); } diff --git a/src/util/mpq_inf.h b/src/util/mpq_inf.h index e2bcbcba61c..d8e9148e1ee 100644 --- a/src/util/mpq_inf.h +++ b/src/util/mpq_inf.h @@ -52,7 +52,7 @@ class mpq_inf_manager { m.del(a.second); } - void swap(mpq_inf & a, mpq_inf & b) { + void swap(mpq_inf & a, mpq_inf & b) noexcept { m.swap(a.first, b.first); m.swap(a.second, b.second); } diff --git a/src/util/mpz.h b/src/util/mpz.h index bb1141ea701..44e3e9c0bb8 100644 --- a/src/util/mpz.h +++ b/src/util/mpz.h @@ -110,7 +110,7 @@ class mpz { return *this; } - void swap(mpz & other) { + void swap(mpz & other) noexcept { std::swap(m_val, other.m_val); std::swap(m_ptr, other.m_ptr); unsigned o = m_owner; m_owner = other.m_owner; other.m_owner = o; @@ -131,7 +131,7 @@ class mpz_stack : public mpz { class mpz_stack : public mpz {}; #endif -inline void swap(mpz & m1, mpz & m2) { m1.swap(m2); } +inline void swap(mpz & m1, mpz & m2) noexcept { m1.swap(m2); } template class mpz_manager { @@ -573,7 +573,7 @@ class mpz_manager { // deallocates any memory. void reset(mpz & a); - void swap(mpz & a, mpz & b) { + void swap(mpz & a, mpz & b) noexcept { std::swap(a.m_val, b.m_val); std::swap(a.m_ptr, b.m_ptr); auto o = a.m_owner; a.m_owner = b.m_owner; b.m_owner = o; diff --git a/src/util/mpzzp.h b/src/util/mpzzp.h index 731b116ceec..24fb64ea309 100644 --- a/src/util/mpzzp.h +++ b/src/util/mpzzp.h @@ -183,7 +183,7 @@ class mpzzp_manager { } } - void swap(mpz & a, mpz & b) { + void swap(mpz & a, mpz & b) noexcept { SASSERT(is_p_normalized(a) && is_p_normalized(b)); m().swap(a, b); } diff --git a/src/util/numeral_buffer.h b/src/util/numeral_buffer.h index 5bd678d782f..1951b54499e 100644 --- a/src/util/numeral_buffer.h +++ b/src/util/numeral_buffer.h @@ -81,7 +81,7 @@ class numeral_buffer { m_buffer.reserve(sz); } - void swap(svector & other) { + void swap(svector & other) noexcept { m_buffer.swap(other); } diff --git a/src/util/obj_hashtable.h b/src/util/obj_hashtable.h index 254f5f70d7d..49b37ca6189 100644 --- a/src/util/obj_hashtable.h +++ b/src/util/obj_hashtable.h @@ -209,7 +209,7 @@ class obj_map { } } - void swap(obj_map & other) { + void swap(obj_map & other) noexcept { m_table.swap(other.m_table); } }; diff --git a/src/util/obj_ref.h b/src/util/obj_ref.h index 04ae9e4124f..9ab68676da9 100644 --- a/src/util/obj_ref.h +++ b/src/util/obj_ref.h @@ -93,7 +93,7 @@ class obj_ref { return *this; } - obj_ref & operator=(obj_ref && n) { + obj_ref & operator=(obj_ref && n) noexcept { SASSERT(&m_manager == &n.m_manager); std::swap(m_obj, n.m_obj); n.reset(); @@ -105,7 +105,7 @@ class obj_ref { m_obj = nullptr; } - void swap(obj_ref & n) { + void swap(obj_ref & n) noexcept { std::swap(m_obj, n.m_obj); } diff --git a/src/util/obj_ref_hashtable.h b/src/util/obj_ref_hashtable.h index d3e17a4a3d2..dba6550d40b 100644 --- a/src/util/obj_ref_hashtable.h +++ b/src/util/obj_ref_hashtable.h @@ -104,7 +104,7 @@ class obj_ref_map { unsigned long long get_num_collision() const { return m_table.get_num_collision(); } - void swap(obj_ref_map & other) { + void swap(obj_ref_map & other) noexcept { m_table.swap(other.m_table); } diff --git a/src/util/optional.h b/src/util/optional.h index 50a2148d10a..8e515f4be7e 100644 --- a/src/util/optional.h +++ b/src/util/optional.h @@ -94,7 +94,7 @@ class optional { return * this; } - optional & operator=(optional && val) { + optional & operator=(optional && val) noexcept { std::swap(m_obj, val.m_obj); return *this; } diff --git a/src/util/permutation.cpp b/src/util/permutation.cpp index 5b20580eb0d..8b7adedf316 100644 --- a/src/util/permutation.cpp +++ b/src/util/permutation.cpp @@ -31,7 +31,7 @@ void permutation::reset(unsigned size) { } } -void permutation::swap(unsigned i, unsigned j) { +void permutation::swap(unsigned i, unsigned j) noexcept { unsigned i_prime = m_p[i]; unsigned j_prime = m_p[j]; std::swap(m_p[i], m_p[j]); diff --git a/src/util/permutation.h b/src/util/permutation.h index 1fb7dc9e727..dfc52b370ac 100644 --- a/src/util/permutation.h +++ b/src/util/permutation.h @@ -31,7 +31,7 @@ class permutation { unsigned operator()(unsigned i) const { return m_p[i]; } unsigned inv(unsigned i_prime) const { return m_inv_p[i_prime]; } - void swap(unsigned i, unsigned j); + void swap(unsigned i, unsigned j) noexcept; void move_after(unsigned i, unsigned j); void display(std::ostream & out) const; diff --git a/src/util/rational.h b/src/util/rational.h index 88a0552ba73..db60077acc0 100644 --- a/src/util/rational.h +++ b/src/util/rational.h @@ -86,7 +86,7 @@ class rational { struct eq_proc { bool operator()(rational const& r1, rational const& r2) const { return r1 == r2; } }; - void swap(rational & n) { m().swap(m_val, n.m_val); } + void swap(rational & n) noexcept { m().swap(m_val, n.m_val); } std::string to_string() const { return m().to_string(m_val); } @@ -671,6 +671,6 @@ inline rational gcd(rational const & r1, rational const & r2, rational & a, rati return result; } -inline void swap(rational& r1, rational& r2) { +inline void swap(rational& r1, rational& r2) noexcept { r1.swap(r2); } diff --git a/src/util/ref.h b/src/util/ref.h index 1f30aae827f..849e23b38cc 100644 --- a/src/util/ref.h +++ b/src/util/ref.h @@ -97,7 +97,7 @@ class ref { return *this; } - ref & operator=(ref &&r) { + ref & operator=(ref &&r) noexcept { if (this != &r) { dec_ref (); m_ptr = r.detach (); @@ -123,7 +123,7 @@ class ref { friend bool operator!=(const ref & r1, const ref & r2) { return r1.m_ptr != r2.m_ptr; } - friend void swap (ref &r1, ref &r2) { + friend void swap (ref &r1, ref &r2) noexcept { T* tmp = r1.m_ptr; r1.m_ptr = r2.m_ptr; r2.m_ptr = tmp; diff --git a/src/util/ref_pair_vector.h b/src/util/ref_pair_vector.h index 489767912d6..40f845af666 100644 --- a/src/util/ref_pair_vector.h +++ b/src/util/ref_pair_vector.h @@ -143,7 +143,7 @@ class ref_pair_vector_core : public Ref { push_back(other[i]); } - void swap(unsigned idx1, unsigned idx2) { + void swap(unsigned idx1, unsigned idx2) noexcept { std::swap(m_nodes[idx1], m_nodes[idx2]); } @@ -179,7 +179,7 @@ class ref_pair_vector : public ref_pair_vector_coreappend(other); } - ref_pair_vector(ref_pair_vector && other) : super(std::move(other)) {} + ref_pair_vector(ref_pair_vector && other) noexcept : super(std::move(other)) {} ref_pair_vector(TManager & m, unsigned sz, elem_t const * data): super(ref_manager_wrapper(m)) { @@ -194,7 +194,7 @@ class ref_pair_vector : public ref_pair_vector_corem_manager) == &(other.m_manager)); this->m_nodes.swap(other.m_nodes); } diff --git a/src/util/ref_vector.h b/src/util/ref_vector.h index 406f7be61e0..3a8492c2927 100644 --- a/src/util/ref_vector.h +++ b/src/util/ref_vector.h @@ -197,14 +197,14 @@ class ref_vector_core : public Ref { push_back(data[i]); } - void operator=(ref_vector_core && other) { + void operator=(ref_vector_core && other) noexcept { if (this != &other) { reset(); m_nodes = std::move(other.m_nodes); } } - void swap(unsigned idx1, unsigned idx2) { + void swap(unsigned idx1, unsigned idx2) noexcept { std::swap(m_nodes[idx1], m_nodes[idx2]); } @@ -262,7 +262,7 @@ class ref_vector : public ref_vector_core > return get_manager(); } - void swap(ref_vector & other) { + void swap(ref_vector & other) noexcept { SASSERT(&(this->m_manager) == &(other.m_manager)); this->m_nodes.swap(other.m_nodes); } diff --git a/src/util/s_integer.h b/src/util/s_integer.h index 506b4f0a363..6ddd2bf6716 100644 --- a/src/util/s_integer.h +++ b/src/util/s_integer.h @@ -34,7 +34,7 @@ class s_integer { struct hash_proc { unsigned operator()(s_integer const& r) const { return r.hash(); } }; struct eq_proc { bool operator()(s_integer const& r1, s_integer const& r2) const { return r1 == r2; } }; - void swap(s_integer & n) { + void swap(s_integer & n) noexcept { std::swap(m_val, n.m_val); } diff --git a/src/util/scoped_numeral.h b/src/util/scoped_numeral.h index 65b75053d68..b90ba640acd 100644 --- a/src/util/scoped_numeral.h +++ b/src/util/scoped_numeral.h @@ -60,11 +60,11 @@ class _scoped_numeral { m().reset(m_num); } - void swap(_scoped_numeral & n) { + void swap(_scoped_numeral & n) noexcept { m().swap(m_num, n.m_num); } - void swap(numeral & n) { + void swap(numeral & n) noexcept { m().swap(m_num, n); } diff --git a/src/util/scoped_ptr_vector.h b/src/util/scoped_ptr_vector.h index 3c33cc70845..90afbb6ef5b 100644 --- a/src/util/scoped_ptr_vector.h +++ b/src/util/scoped_ptr_vector.h @@ -34,7 +34,7 @@ class scoped_ptr_vector { scoped_ptr_vector(scoped_ptr_vector&& other) noexcept { m_vector.swap(other.m_vector); } - scoped_ptr_vector& operator=(scoped_ptr_vector&& other) { + scoped_ptr_vector& operator=(scoped_ptr_vector&& other) noexcept { if (this == &other) return *this; reset(); @@ -55,7 +55,7 @@ class scoped_ptr_vector { dealloc(m_vector[idx]); m_vector[idx] = ptr; } - void swap(unsigned i, unsigned j) { std::swap(m_vector[i], m_vector[j]); } + void swap(unsigned i, unsigned j) noexcept { std::swap(m_vector[i], m_vector[j]); } unsigned size() const { return m_vector.size(); } bool empty() const { return m_vector.empty(); } void resize(unsigned sz) { diff --git a/src/util/tbv.h b/src/util/tbv.h index cffdc2460c4..3bda89b3f97 100644 --- a/src/util/tbv.h +++ b/src/util/tbv.h @@ -135,7 +135,7 @@ class tbv_ref { public: tbv_ref(tbv_manager& mgr) : mgr(mgr), d(nullptr) {} tbv_ref(tbv_manager& mgr, tbv* d) : mgr(mgr), d(d) {} - tbv_ref(tbv_ref&& d) : mgr(d.mgr), d(d.detach()) {} + tbv_ref(tbv_ref&& d) noexcept : mgr(d.mgr), d(d.detach()) {} ~tbv_ref() { if (d) mgr.deallocate(d); } diff --git a/src/util/uint_set.h b/src/util/uint_set.h index 2106d7af86b..73c3bce1fed 100644 --- a/src/util/uint_set.h +++ b/src/util/uint_set.h @@ -28,7 +28,7 @@ class uint_set : unsigned_vector { typedef unsigned data; - void swap(uint_set & other) { + void swap(uint_set & other) noexcept { unsigned_vector::swap(other); } diff --git a/src/util/util.h b/src/util/util.h index 2753745127e..a4bf78073ab 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -265,7 +265,7 @@ class scoped_ptr { return *this; } - scoped_ptr& operator=(scoped_ptr&& other) { + scoped_ptr& operator=(scoped_ptr&& other) noexcept { *this = other.detach(); return *this; }; @@ -276,7 +276,7 @@ class scoped_ptr { return tmp; } - void swap(scoped_ptr & p) { + void swap(scoped_ptr & p) noexcept { std::swap(m_ptr, p.m_ptr); } }; diff --git a/src/util/vector.h b/src/util/vector.h index 55b52d7459b..ea621b5fbb1 100644 --- a/src/util/vector.h +++ b/src/util/vector.h @@ -330,7 +330,7 @@ class vector { return *this; } - vector & operator=(vector && source) { + vector & operator=(vector && source) noexcept { if (this == &source) { return *this; }