3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 04:03:39 +00:00

delete more default constructors

reduces code size by 0.1%
This commit is contained in:
Nuno Lopes 2024-09-23 12:13:52 +01:00
parent 4b4a28239f
commit 737c2208fa
41 changed files with 35 additions and 91 deletions

View file

@ -60,8 +60,6 @@ class ackr_bound_probe : public probe {
}; };
public: public:
ackr_bound_probe() {}
result operator()(goal const & g) override { result operator()(goal const & g) override {
proc p(g.m()); proc p(g.m());
unsigned sz = g.size(); unsigned sz = g.size();

View file

@ -71,9 +71,6 @@ protected:
void display_del(std::ostream& out, func_decl* f) const; void display_del(std::ostream& out, func_decl* f) const;
void display_add(std::ostream& out, ast_manager& m); void display_add(std::ostream& out, ast_manager& m);
public: public:
model_converter() {}
void set_completion(bool f) { m_completion = f; } void set_completion(bool f) { m_completion = f; }
virtual void operator()(model_ref & m) = 0; virtual void operator()(model_ref & m) = 0;

View file

@ -417,7 +417,6 @@ namespace recfun {
} }
namespace decl { namespace decl {
plugin::plugin() : decl_plugin(), m_defs(), m_case_defs() {}
plugin::~plugin() { finalize(); } plugin::~plugin() { finalize(); }
void plugin::finalize() { void plugin::finalize() {

View file

@ -173,7 +173,6 @@ namespace recfun {
void compute_scores(expr* e, obj_map<expr, unsigned>& scores); void compute_scores(expr* e, obj_map<expr, unsigned>& scores);
public: public:
plugin();
~plugin() override; ~plugin() override;
void finalize() override; void finalize() override;

View file

@ -94,7 +94,7 @@ class expr_free_vars {
ptr_vector<sort> m_sorts; ptr_vector<sort> m_sorts;
ptr_vector<expr> m_todo; ptr_vector<expr> m_todo;
public: public:
expr_free_vars() {} expr_free_vars() = default;
expr_free_vars(expr* e) { (*this)(e); } expr_free_vars(expr* e) { (*this)(e); }
void reset(); void reset();
void operator()(expr* e); void operator()(expr* e);

View file

@ -35,7 +35,7 @@ private:
mpz * m_as; // precise coefficients mpz * m_as; // precise coefficients
double * m_approx_as; // approximated coefficients double * m_approx_as; // approximated coefficients
var * m_xs; // var ids var * m_xs; // var ids
linear_equation() {} linear_equation() = default;
public: public:
unsigned size() const { return m_size; } unsigned size() const { return m_size; }
mpz const & a(unsigned idx) const { SASSERT(idx < m_size); return m_as[idx]; } mpz const & a(unsigned idx) const { SASSERT(idx < m_size); return m_as[idx]; }

View file

@ -47,7 +47,7 @@ class func_decls {
bool signatures_collide(func_decl* f, func_decl* g) const; bool signatures_collide(func_decl* f, func_decl* g) const;
bool signatures_collide(unsigned n, sort*const* domain, sort* range, func_decl* g) const; bool signatures_collide(unsigned n, sort*const* domain, sort* range, func_decl* g) const;
public: public:
func_decls() {} func_decls() = default;
func_decls(ast_manager & m, func_decl * f); func_decls(ast_manager & m, func_decl * f);
void finalize(ast_manager & m); void finalize(ast_manager & m);
bool contains(func_decl * f) const; bool contains(func_decl * f) const;

View file

@ -26,7 +26,7 @@ namespace bv {
bool tight = true; bool tight = true;
interval_tpl(T const& l, T const& h, unsigned sz, bool tight = false): l(l), h(h), sz(sz), tight(tight) {} interval_tpl(T const& l, T const& h, unsigned sz, bool tight = false): l(l), h(h), sz(sz), tight(tight) {}
interval_tpl() {} interval_tpl() = default;
bool invariant() const { bool invariant() const {
return return
@ -167,7 +167,7 @@ namespace bv {
iinterval i; iinterval i;
rinterval r; rinterval r;
interval() {} interval() = default;
interval(rational const& l, rational const& h, unsigned sz, bool tight = false) { interval(rational const& l, rational const& h, unsigned sz, bool tight = false) {
if (sz <= 64) { if (sz <= 64) {

View file

@ -24,7 +24,7 @@ class factor {
factor_type m_type = factor_type::VAR; factor_type m_type = factor_type::VAR;
bool m_sign = false; bool m_sign = false;
public: public:
factor() { } factor() = default;
explicit factor(lpvar v, factor_type t) : m_var(v), m_type(t) {} explicit factor(lpvar v, factor_type t) : m_var(v), m_type(t) {}
unsigned var() const { return m_var; } unsigned var() const { return m_var; }
factor_type type() const { return m_type; } factor_type type() const { return m_type; }

View file

@ -29,7 +29,7 @@ public:
// m_other is the offset of the corresponding element in its vector : for a row element it points to the column element offset, // m_other is the offset of the corresponding element in its vector : for a row element it points to the column element offset,
// for a column element it points to the row element offset // for a column element it points to the row element offset
unsigned m_other; unsigned m_other;
indexed_value() {} indexed_value() = default;
indexed_value(T v, unsigned i, unsigned other) : indexed_value(T v, unsigned i, unsigned other) :
m_value(v), m_index(i), m_other(other) { m_value(v), m_index(i), m_other(other) {

View file

@ -92,7 +92,7 @@ public:
virtual const rational& coeff() const { return rational::one(); } virtual const rational& coeff() const { return rational::one(); }
#ifdef Z3DEBUG #ifdef Z3DEBUG
virtual void sort() {}; virtual void sort() {}
#endif #endif
bool virtual is_linear() const = 0; bool virtual is_linear() const = 0;
}; };

View file

@ -116,10 +116,7 @@ template <typename T>
struct numeric_pair { struct numeric_pair {
T x; T x;
T y; T y;
// empty constructor numeric_pair() = default;
numeric_pair() {}
// another constructor
numeric_pair(T xp, T yp) : x(xp), y(yp) {} numeric_pair(T xp, T yp) : x(xp), y(yp) {}
template <typename X> template <typename X>

View file

@ -52,7 +52,7 @@ class permutation_matrix
}; };
public: public:
permutation_matrix() {} permutation_matrix() = default;
permutation_matrix(unsigned length); permutation_matrix(unsigned length);
permutation_matrix(unsigned length, vector<unsigned> const & values); permutation_matrix(unsigned length, vector<unsigned> const & values);

View file

@ -98,9 +98,6 @@ private:
} }
} }
public: public:
stacked_vector() { }
ref operator[] (unsigned a) { ref operator[] (unsigned a) {
return ref(*this, a); return ref(*this, a);
} }

View file

@ -105,7 +105,7 @@ public:
void init_row_columns(unsigned m, unsigned n); void init_row_columns(unsigned m, unsigned n);
// constructor with no parameters // constructor with no parameters
static_matrix() {} static_matrix() = default;
// constructor // constructor
static_matrix(unsigned m, unsigned n): m_vector_of_row_offsets(n, -1) { static_matrix(unsigned m, unsigned n): m_vector_of_row_offsets(n, -1) {

View file

@ -81,7 +81,7 @@ class var_eqs {
mutable stats m_stats; mutable stats m_stats;
public: public:
var_eqs(): m_merge_handler(nullptr), m_uf(*this), m_stack() {} var_eqs(): m_merge_handler(nullptr), m_uf(*this) {}
/** /**
\brief push a scope */ \brief push a scope */
void push() { void push() {

View file

@ -27,7 +27,7 @@ class ext_var_info {
bool m_is_integer; bool m_is_integer;
std::string m_name; std::string m_name;
public: public:
ext_var_info() {} ext_var_info() = default;
ext_var_info(unsigned j): ext_var_info(j, true) {} ext_var_info(unsigned j): ext_var_info(j, true) {}
ext_var_info(unsigned j , bool is_int) : m_external_j(j), m_is_integer(is_int) {} ext_var_info(unsigned j , bool is_int) : m_external_j(j), m_is_integer(is_int) {}
ext_var_info(unsigned j , bool is_int, std::string name) : m_external_j(j), m_is_integer(is_int), m_name(name) {} ext_var_info(unsigned j , bool is_int, std::string name) : m_external_j(j), m_is_integer(is_int), m_name(name) {}

View file

@ -91,7 +91,7 @@ namespace polynomial {
*/ */
class power : public std::pair<var, unsigned> { class power : public std::pair<var, unsigned> {
public: public:
power():std::pair<var, unsigned>() {} power() = default;
power(var v, unsigned d):std::pair<var, unsigned>(v, d) {} power(var v, unsigned d):std::pair<var, unsigned>(v, d) {}
var get_var() const { return first; } var get_var() const { return first; }
unsigned degree() const { return second; } unsigned degree() const { return second; }
@ -1895,7 +1895,7 @@ namespace polynomial {
Invoke add(...), addmul(...) several times, and then invoke mk() to obtain the final polynomial. Invoke add(...), addmul(...) several times, and then invoke mk() to obtain the final polynomial.
*/ */
class som_buffer { class som_buffer {
imp * m_owner; imp * m_owner = nullptr;
monomial2pos m_m2pos; monomial2pos m_m2pos;
numeral_vector m_tmp_as; numeral_vector m_tmp_as;
monomial_vector m_tmp_ms; monomial_vector m_tmp_ms;
@ -1939,8 +1939,6 @@ namespace polynomial {
} }
public: public:
som_buffer():m_owner(nullptr) {}
void reset() { void reset() {
if (empty()) if (empty())
return; return;
@ -2236,12 +2234,10 @@ namespace polynomial {
In this buffer, each monomial can be added at most once. In this buffer, each monomial can be added at most once.
*/ */
class cheap_som_buffer { class cheap_som_buffer {
imp * m_owner; imp * m_owner = nullptr;
numeral_vector m_tmp_as; numeral_vector m_tmp_as;
monomial_vector m_tmp_ms; monomial_vector m_tmp_ms;
public: public:
cheap_som_buffer():m_owner(nullptr) {}
void set_owner(imp * o) { m_owner = o; } void set_owner(imp * o) { m_owner = o; }
bool empty() const { return m_tmp_ms.empty(); } bool empty() const { return m_tmp_ms.empty(); }
@ -3072,11 +3068,9 @@ namespace polynomial {
} }
class newton_interpolator_vector { class newton_interpolator_vector {
imp * m_imp; imp * m_imp = nullptr;
ptr_vector<newton_interpolator> m_data; ptr_vector<newton_interpolator> m_data;
public: public:
newton_interpolator_vector():m_imp(nullptr) {}
~newton_interpolator_vector() { ~newton_interpolator_vector() {
flush(); flush();
} }

View file

@ -64,7 +64,7 @@ namespace upolynomial {
public: public:
factorization_degree_set() { } factorization_degree_set() = default;
factorization_degree_set(zp_factors const & factors) factorization_degree_set(zp_factors const & factors)
{ {

View file

@ -43,7 +43,7 @@ namespace opt {
struct var { struct var {
unsigned m_id { 0 }; unsigned m_id { 0 };
rational m_coeff; rational m_coeff;
var() {} var() = default;
var(unsigned id, rational const& c): m_id(id), m_coeff(c) {} var(unsigned id, rational const& c): m_id(id), m_coeff(c) {}
struct compare { struct compare {
bool operator()(var x, var y) { bool operator()(var x, var y) {
@ -76,11 +76,11 @@ namespace opt {
// A definition is a linear term of the form (vars + coeff) / div // A definition is a linear term of the form (vars + coeff) / div
struct def { struct def {
def(): m_div(1) {} def() = default;
def(row const& r, unsigned x); def(row const& r, unsigned x);
vector<var> m_vars; vector<var> m_vars;
rational m_coeff; rational m_coeff;
rational m_div; rational m_div{1};
def operator+(def const& other) const; def operator+(def const& other) const;
def operator/(unsigned n) const { return *this / rational(n); } def operator/(unsigned n) const { return *this / rational(n); }
def operator/(rational const& n) const; def operator/(rational const& n) const;

View file

@ -393,8 +393,6 @@ namespace datalog {
class skip_model_converter : public model_converter { class skip_model_converter : public model_converter {
public: public:
skip_model_converter() {}
model_converter * translate(ast_translation & translator) override { model_converter * translate(ast_translation & translator) override {
return alloc(skip_model_converter); return alloc(skip_model_converter);
} }

View file

@ -56,8 +56,7 @@ struct dl_context {
m_cmd(ctx), m_cmd(ctx),
m_collected_cmds(collected_cmds), m_collected_cmds(collected_cmds),
m_ref_count(0), m_ref_count(0),
m_decl_plugin(nullptr), m_decl_plugin(nullptr) {}
m_trail() {}
void inc_ref() { void inc_ref() {
++m_ref_count; ++m_ref_count;

View file

@ -54,8 +54,6 @@ namespace datalog {
var_idx_set m_all_nonlocal_vars; var_idx_set m_all_nonlocal_vars;
rule_vector m_rules; rule_vector m_rules;
pair_info() {}
pair_info & operator=(const pair_info &) = delete; pair_info & operator=(const pair_info &) = delete;
bool can_be_joined() const { bool can_be_joined() const {
return m_consumers > 0; return m_consumers > 0;

View file

@ -1043,7 +1043,6 @@ namespace datalog {
class relation_manager::null_signature_table_project_fn : public table_transformer_fn { class relation_manager::null_signature_table_project_fn : public table_transformer_fn {
const table_signature m_empty_sig; const table_signature m_empty_sig;
public: public:
null_signature_table_project_fn() : m_empty_sig() {}
table_base * operator()(const table_base & t) override { table_base * operator()(const table_base & t) override {
relation_manager & m = t.get_plugin().get_manager(); relation_manager & m = t.get_plugin().get_manager();
table_base * res = m.mk_empty_table(m_empty_sig); table_base * res = m.mk_empty_table(m_empty_sig);

View file

@ -36,7 +36,7 @@ namespace datalog {
/** /**
Create uninitialized rel_spec. Create uninitialized rel_spec.
*/ */
rel_spec() {} rel_spec() = default;
/** /**
\c inner_kind==null_family_id means we will not specify a relation kind when requesting \c inner_kind==null_family_id means we will not specify a relation kind when requesting
the relation object from the relation_manager. the relation object from the relation_manager.

View file

@ -674,8 +674,6 @@ namespace datalog {
class karr_relation_plugin::union_fn : public relation_union_fn { class karr_relation_plugin::union_fn : public relation_union_fn {
public: public:
union_fn() {}
void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override { void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override {
karr_relation& r = get(_r); karr_relation& r = get(_r);

View file

@ -491,8 +491,6 @@ namespace datalog {
} }
class udoc_plugin::union_fn : public relation_union_fn { class udoc_plugin::union_fn : public relation_union_fn {
public: public:
union_fn() {}
void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override { void operator()(relation_base & _r, const relation_base & _src, relation_base * _delta) override {
TRACE("doc", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n");); TRACE("doc", _r.display(tout << "dst:\n"); _src.display(tout << "src:\n"););
udoc_relation& r = get(_r); udoc_relation& r = get(_r);
@ -1040,8 +1038,6 @@ namespace datalog {
class udoc_plugin::join_project_and_fn : public relation_join_fn { class udoc_plugin::join_project_and_fn : public relation_join_fn {
public: public:
join_project_and_fn() {}
relation_base* operator()(relation_base const& t1, relation_base const& t2) override { relation_base* operator()(relation_base const& t1, relation_base const& t2) override {
udoc_relation *result = get(t1.clone()); udoc_relation *result = get(t1.clone());
result->get_udoc().intersect(result->get_dm(), get(t2).get_udoc()); result->get_udoc().intersect(result->get_dm(), get(t2).get_udoc());

View file

@ -45,8 +45,6 @@ bool spacer_arith_kernel::compute_kernel() {
namespace { namespace {
class simplex_arith_kernel_plugin : public spacer_arith_kernel::plugin { class simplex_arith_kernel_plugin : public spacer_arith_kernel::plugin {
public: public:
simplex_arith_kernel_plugin() {}
bool compute_kernel(const spacer_matrix &in, spacer_matrix &out, bool compute_kernel(const spacer_matrix &in, spacer_matrix &out,
vector<unsigned> &basics) override { vector<unsigned> &basics) override {
using qmatrix = simplex::sparse_matrix<simplex::mpq_ext>; using qmatrix = simplex::sparse_matrix<simplex::mpq_ext>;

View file

@ -65,7 +65,7 @@ namespace datalog {
func_decl * m_pred; func_decl * m_pred;
adornment m_adornment; adornment m_adornment;
adornment_desc() {} adornment_desc() = default;
adornment_desc(func_decl * pred) : m_pred(pred) {} adornment_desc(func_decl * pred) : m_pred(pred) {}
adornment_desc(func_decl * pred, const adornment & a) adornment_desc(func_decl * pred, const adornment & a)
: m_pred(pred), m_adornment(a) {} : m_pred(pred), m_adornment(a) {}

View file

@ -777,7 +777,7 @@ public:
ptr_vector<expr> es; ptr_vector<expr> es;
unsigned k = 0; unsigned k = 0;
rational weight; rational weight;
bound_info() {} bound_info() = default;
bound_info(ptr_vector<expr> const& es, unsigned k, rational const& weight): bound_info(ptr_vector<expr> const& es, unsigned k, rational const& weight):
es(es), k(k), weight(weight) {} es(es), k(k), weight(weight) {}
bound_info(expr_ref_vector const& es, unsigned k, rational const& weight): bound_info(expr_ref_vector const& es, unsigned k, rational const& weight):

View file

@ -95,7 +95,6 @@ namespace sat {
}; };
struct var_info { struct var_info {
var_info() {}
bool m_value = false; bool m_value = false;
double m_reward = 0; double m_reward = 0;
double m_last_reward = 0; double m_last_reward = 0;

View file

@ -428,19 +428,11 @@ namespace arith {
* Facility to put a small box around integer variables used in branch and bounds. * Facility to put a small box around integer variables used in branch and bounds.
*/ */
struct bound_info {
rational m_offset;
unsigned m_range;
bound_info() {}
bound_info(rational const& o, unsigned r) :m_offset(o), m_range(r) {}
};
unsigned m_bounded_range_idx; // current size of bounded range. unsigned m_bounded_range_idx; // current size of bounded range.
literal m_bounded_range_lit; // current bounded range literal literal m_bounded_range_lit; // current bounded range literal
expr_ref_vector m_bound_terms; // predicates used for bounds expr_ref_vector m_bound_terms; // predicates used for bounds
expr_ref m_bound_predicate; expr_ref m_bound_predicate;
obj_map<expr, expr*> m_predicate2term;
obj_map<expr, bound_info> m_term2bound_info;
bool m_model_is_initialized = false; bool m_model_is_initialized = false;
unsigned small_lemma_size() const { return get_config().m_arith_small_lemma_size; } unsigned small_lemma_size() const { return get_config().m_arith_small_lemma_size; }

View file

@ -39,7 +39,7 @@ namespace q {
class mam { class mam {
friend class mam_impl; friend class mam_impl;
mam() {} mam() = default;
public: public:

View file

@ -41,8 +41,6 @@ struct theory_array_params {
unsigned m_array_lazy_ieq_delay = 10; unsigned m_array_lazy_ieq_delay = 10;
bool m_array_fake_support = false; // fake support for all array operations to pretend they are satisfiable. bool m_array_fake_support = false; // fake support for all array operations to pretend they are satisfiable.
theory_array_params() {}
void updt_params(params_ref const & _p); void updt_params(params_ref const & _p);
void display(std::ostream & out) const; void display(std::ostream & out) const;

View file

@ -3806,19 +3806,10 @@ public:
* Facility to put a small box around integer variables used in branch and bounds. * Facility to put a small box around integer variables used in branch and bounds.
*/ */
struct bound_info {
rational m_offset;
unsigned m_range;
bound_info() {}
bound_info(rational const& o, unsigned r):m_offset(o), m_range(r) {}
};
unsigned m_bounded_range_idx; // current size of bounded range. unsigned m_bounded_range_idx; // current size of bounded range.
literal m_bounded_range_lit; // current bounded range literal literal m_bounded_range_lit; // current bounded range literal
expr_ref_vector m_bound_terms; // predicates used for bounds expr_ref_vector m_bound_terms; // predicates used for bounds
expr_ref m_bound_predicate; expr_ref m_bound_predicate;
obj_map<expr, expr*> m_predicate2term;
obj_map<expr, bound_info> m_term2bound_info;
unsigned init_range() const { return 5; } unsigned init_range() const { return 5; }
unsigned max_range() const { return 20; } unsigned max_range() const { return 20; }
@ -3828,8 +3819,6 @@ public:
m_bounded_range_lit = null_literal; m_bounded_range_lit = null_literal;
m_bound_terms.reset(); m_bound_terms.reset();
m_bound_predicate = nullptr; m_bound_predicate = nullptr;
m_predicate2term.reset();
m_term2bound_info.reset();
} }

View file

@ -25,7 +25,7 @@ Author:
#include "ast/ast_pp.h" #include "ast/ast_pp.h"
class pb_preprocess_tactic : public tactic { class pb_preprocess_tactic : public tactic {
struct rec { unsigned_vector pos, neg; rec() { } }; struct rec { unsigned_vector pos, neg; };
typedef obj_map<app, rec> var_map; typedef obj_map<app, rec> var_map;
ast_manager& m; ast_manager& m;
expr_ref_vector m_trail; expr_ref_vector m_trail;

View file

@ -26,7 +26,7 @@ public:
private: private:
#define ARRAY_SIZE_IDX -1 #define ARRAY_SIZE_IDX -1
T * m_data; T * m_data = nullptr;
void destroy_elements() { void destroy_elements() {
iterator it = begin(); iterator it = begin();
iterator e = end(); iterator e = end();
@ -71,7 +71,7 @@ public:
typedef T * iterator; typedef T * iterator;
typedef const T * const_iterator; typedef const T * const_iterator;
array():m_data(nullptr) {} array() = default;
/** /**
\brief Store the array in the given chunk of memory (mem). \brief Store the array in the given chunk of memory (mem).
@ -193,7 +193,7 @@ public:
template<typename T> template<typename T>
class ptr_array : public array<T *, false> { class ptr_array : public array<T *, false> {
public: public:
ptr_array() {} ptr_array() = default;
ptr_array(void * mem, unsigned sz, T * const * vs):array<T*, false>(mem, sz, vs) {} ptr_array(void * mem, unsigned sz, T * const * vs):array<T*, false>(mem, sz, vs) {}
template<typename Allocator> template<typename Allocator>
ptr_array(Allocator & a, unsigned sz, T * const * vs):array<T*, false>(a, sz, vs) {} ptr_array(Allocator & a, unsigned sz, T * const * vs):array<T*, false>(a, sz, vs) {}
@ -205,7 +205,7 @@ public:
template<typename T> template<typename T>
class sarray : public array<T, false> { class sarray : public array<T, false> {
public: public:
sarray() {} sarray() = default;
sarray(void * mem, unsigned sz, T const * vs):array<T, false>(mem, sz, vs) {} sarray(void * mem, unsigned sz, T const * vs):array<T, false>(mem, sz, vs) {}
template<typename Allocator> template<typename Allocator>
sarray(Allocator & a, unsigned sz, T const * vs):array<T, false>(a, sz, vs) {} sarray(Allocator & a, unsigned sz, T const * vs):array<T, false>(a, sz, vs) {}

View file

@ -275,6 +275,6 @@ public:
template<typename T, unsigned INITIAL_SIZE=16> template<typename T, unsigned INITIAL_SIZE=16>
class sbuffer : public buffer<T, false, INITIAL_SIZE> { class sbuffer : public buffer<T, false, INITIAL_SIZE> {
public: public:
sbuffer(): buffer<T, false, INITIAL_SIZE>() {} sbuffer() = default;
sbuffer(unsigned sz, const T& elem) : buffer<T, false, INITIAL_SIZE>(sz,elem) {} sbuffer(unsigned sz, const T& elem) : buffer<T, false, INITIAL_SIZE>(sz,elem) {}
}; };

View file

@ -65,7 +65,7 @@ class inf_rational {
return s; return s;
} }
inf_rational() {} inf_rational() = default;
explicit inf_rational(int n): explicit inf_rational(int n):
m_first(rational(n)), m_first(rational(n)),

View file

@ -119,7 +119,7 @@ namespace sat {
literal_set(literal_vector const& v) { literal_set(literal_vector const& v) {
for (unsigned i = 0; i < v.size(); ++i) insert(v[i]); for (unsigned i = 0; i < v.size(); ++i) insert(v[i]);
} }
literal_set() {} literal_set() = default;
literal_vector to_vector() const { literal_vector to_vector() const {
literal_vector result; literal_vector result;
for (literal lit : *this) result.push_back(lit); for (literal lit : *this) result.push_back(lit);
@ -146,7 +146,6 @@ namespace sat {
literal operator*() const { return to_literal(*m_it); } literal operator*() const { return to_literal(*m_it); }
iterator& operator++() { ++m_it; return *this; } iterator& operator++() { ++m_it; return *this; }
iterator operator++(int) { iterator tmp = *this; ++m_it; return tmp; } iterator operator++(int) { iterator tmp = *this; ++m_it; return tmp; }
bool operator==(iterator const& it) const { return m_it == it.m_it; }
bool operator!=(iterator const& it) const { return m_it != it.m_it; } bool operator!=(iterator const& it) const { return m_it != it.m_it; }
}; };
iterator begin() const { return iterator(m_set.begin()); } iterator begin() const { return iterator(m_set.begin()); }

View file

@ -52,7 +52,7 @@ public:
} }
} }
stacked_value() {} stacked_value() = default;
stacked_value(const T& m) { stacked_value(const T& m) {
m_value = m; m_value = m;
} }