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

Use = delete to delete special methods.

This provides a better experience than just marking them as
private and leaving them as undefined symbols.
This commit is contained in:
Bruce Mitchener 2022-08-01 22:45:50 +07:00 committed by Nikolaj Bjorner
parent 059b795faa
commit 82d853e5f8
9 changed files with 24 additions and 30 deletions

View file

@ -180,10 +180,9 @@ namespace datalog {
public:
base_fn() = default;
virtual ~base_fn() {}
private:
//private and undefined copy constructor and operator= to avoid copying
base_fn(const base_fn &);
base_fn& operator=(const base_fn &);
base_fn(const base_fn &) = delete;
base_fn& operator=(const base_fn &) = delete;
};
class join_fn : public base_fn {
@ -1098,6 +1097,9 @@ namespace datalog {
iterator_core() : m_ref_cnt(0) {}
virtual ~iterator_core() {}
iterator_core(const iterator_core &) = delete;
iterator_core & operator=(const iterator_core &) = delete;
void inc_ref() { m_ref_cnt++; }
void dec_ref() {
SASSERT(m_ref_cnt>0);
@ -1116,10 +1118,6 @@ namespace datalog {
//the equality with the end() iterator
return is_finished() && it.is_finished();
}
private:
//private and undefined copy constructor and assignment operator
iterator_core(const iterator_core &);
iterator_core & operator=(const iterator_core &);
};
struct row_iterator_core {
@ -1128,6 +1126,9 @@ namespace datalog {
row_iterator_core() : m_ref_cnt(0) {}
virtual ~row_iterator_core() {}
row_iterator_core(const row_iterator_core &) = delete;
row_iterator_core & operator=(const row_iterator_core &) = delete;
void inc_ref() { m_ref_cnt++; }
void dec_ref() {
SASSERT(m_ref_cnt>0);
@ -1146,10 +1147,6 @@ namespace datalog {
//the equality with the end() iterator
return is_finished() && it.is_finished();
}
private:
//private and undefined copy constructor and assignment operator
row_iterator_core(const row_iterator_core &);
row_iterator_core & operator=(const row_iterator_core &);
};
public:

View file

@ -56,6 +56,7 @@ namespace datalog {
pair_info() {}
pair_info & operator=(const pair_info &) = delete;
bool can_be_joined() const {
return m_consumers > 0;
}
@ -110,8 +111,6 @@ namespace datalog {
SASSERT(!m_rules.empty() || m_consumers == 0);
return m_rules.empty();
}
private:
pair_info & operator=(const pair_info &); //to avoid the implicit one
};
typedef std::pair<app*, app*> app_pair;
typedef pair_hash<obj_ptr_hash<app>, obj_ptr_hash<app> > app_pair_hash;