3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

remove a hundred implicit constructors/destructors

This commit is contained in:
Nuno Lopes 2021-05-23 14:25:01 +01:00
parent f8406623b4
commit f1e0d5dc8a
55 changed files with 30 additions and 140 deletions

View file

@ -164,7 +164,7 @@ typedef approx_set_tpl<unsigned, u2u> u_approx_set;
class approx_set : public u_approx_set {
public:
approx_set():u_approx_set() {}
approx_set() = default;
approx_set(unsigned e):u_approx_set(e) {}
class iterator {

View file

@ -33,7 +33,6 @@ public:
bound m_lower;
bound m_upper;
public:
interval() {}
bound const & lower() const { return m_lower; }
bound const & upper() const { return m_upper; }
bound & lower() { return m_lower; }

View file

@ -87,11 +87,13 @@ public:
push_back(std::move(source.m_buffer[i]));
}
} else {
m_pos = source.m_pos;
m_capacity = source.m_capacity;
m_buffer = source.m_buffer;
source.m_buffer = reinterpret_cast<T*>(source.m_initial_buffer);
source.m_pos = 0;
m_buffer = source.m_buffer;
m_pos = source.m_pos;
m_capacity = source.m_capacity;
m_buffer = source.m_buffer;
source.m_buffer = reinterpret_cast<T*>(source.m_initial_buffer);
source.m_pos = 0;
source.m_capacity = INITIAL_SIZE;
}
}

View file

@ -20,8 +20,4 @@ Notes:
#include "util/symbol.h"
template<typename T>
class dictionary : public map<symbol, T, symbol_hash_proc, symbol_eq_proc> {
public:
dictionary() {}
};
using dictionary = map<symbol, T, symbol_hash_proc, symbol_eq_proc>;

View file

@ -44,11 +44,10 @@ typedef enum { HT_FREE,
template<typename T>
class default_hash_entry {
unsigned m_hash{ 0 }; //!< cached hash code
hash_entry_state m_state;
hash_entry_state m_state = HT_FREE;
T m_data;
public:
typedef T data;
default_hash_entry():m_state(HT_FREE), m_data() {}
unsigned get_hash() const { return m_hash; }
bool is_free() const { return m_state == HT_FREE; }
bool is_deleted() const { return m_state == HT_DELETED; }
@ -67,10 +66,9 @@ public:
template<int Free, int Deleted>
class int_hash_entry {
unsigned m_hash; //!< cached hash code
int m_data;
int m_data = Free;
public:
typedef int data;
int_hash_entry():m_data(Free) {}
unsigned get_hash() const { return m_hash; }
bool is_free() const { return m_data == Free; }
bool is_deleted() const { return m_data == Deleted; }
@ -89,10 +87,9 @@ public:
template<typename T>
class ptr_hash_entry {
unsigned m_hash; //!< cached hash code
T * m_ptr;
T * m_ptr = nullptr;
public:
typedef T * data;
ptr_hash_entry():m_ptr(nullptr) {}
unsigned get_hash() const { return m_hash; }
bool is_free() const { return m_ptr == nullptr; }
bool is_deleted() const { return m_ptr == reinterpret_cast<T *>(1); }
@ -112,10 +109,9 @@ public:
*/
template<typename T>
class ptr_addr_hash_entry : public ptr_hash_entry<T> {
T * m_ptr;
T * m_ptr = nullptr;
public:
typedef T * data;
ptr_addr_hash_entry():m_ptr(nullptr) {}
unsigned get_hash() const { return get_ptr_hash(m_ptr); }
bool is_free() const { return m_ptr == nullptr; }
bool is_deleted() const { return m_ptr == reinterpret_cast<T *>(1); }

View file

@ -22,8 +22,6 @@ template<typename T>
class lim_svector : public svector<T, unsigned> {
unsigned_vector m_lim;
public:
lim_svector() {}
void push_scope() {
m_lim.push_back(this->size());
}

View file

@ -86,8 +86,6 @@ class max_cliques : public T {
unsigned_vector const& next(unsigned vertex) const { return m_next[vertex]; }
public:
max_cliques() {}
void add_edge(unsigned src, unsigned dst) {
m_next.reserve(std::max(src, dst) + 1);
m_next.reserve(std::max(negate(src), negate(dst)) + 1);

View file

@ -29,10 +29,9 @@ Revision History:
*/
template<typename T>
class obj_hash_entry {
T * m_ptr;
T * m_ptr = nullptr;
public:
typedef T * data;
obj_hash_entry():m_ptr(nullptr) {}
unsigned get_hash() const { return m_ptr->hash(); }
bool is_free() const { return m_ptr == nullptr; }
bool is_deleted() const { return m_ptr == reinterpret_cast<T *>(1); }
@ -82,7 +81,6 @@ public:
key_data m_data;
public:
typedef key_data data;
obj_map_entry() {}
unsigned get_hash() const { return m_data.hash(); }
bool is_free() const { return m_data.m_key == nullptr; }
bool is_deleted() const { return m_data.m_key == reinterpret_cast<Key *>(1); }

View file

@ -29,11 +29,10 @@ Revision History:
template<typename T1, typename T2>
class obj_pair_hash_entry {
unsigned m_hash; // cached hash code
std::pair<T1*, T2*> m_data;
std::pair<T1*, T2*> m_data { nullptr, nullptr };
public:
typedef std::pair<T1*, T2*> data;
obj_pair_hash_entry():m_data(static_cast<T1*>(nullptr),static_cast<T2*>(nullptr)) {}
unsigned get_hash() const { return m_hash; }
bool is_free() const { return m_data.first == 0; }
bool is_deleted() const { return m_data.first == reinterpret_cast<T1 *>(1); }
@ -94,7 +93,6 @@ protected:
key_data m_data;
public:
typedef key_data data;
entry() {}
unsigned get_hash() const { return m_data.hash(); }
bool is_free() const { return m_data.m_key1 == nullptr; }
bool is_deleted() const { return m_data.m_key1 == reinterpret_cast<Key1 *>(1); }

View file

@ -34,7 +34,6 @@ protected:
typedef chashtable<obj_pair, hash_proc, eq_proc> set;
set m_set;
public:
obj_pair_set() {}
void insert(T1 * t1, T2 * t2) { m_set.insert(obj_pair(t1, t2)); }
void insert(obj_pair const & p) { m_set.insert(p); }
bool insert_if_not_there(T1 * t1, T2 * t2) { return m_set.insert_if_not_there2(obj_pair(t1, t2)); }

View file

@ -30,11 +30,10 @@ Revision History:
template<typename T1, typename T2, typename T3>
class obj_triple_hash_entry {
unsigned m_hash; // cached hash code
triple<T1*, T2*, T3*> m_data;
triple<T1*, T2*, T3*> m_data { nullptr, nullptr, nullptr };
public:
typedef triple<T1*, T2*, T3*> data;
obj_triple_hash_entry():m_data(0,0,0) {}
unsigned get_hash() const { return m_hash; }
bool is_free() const { return m_data.first == 0; }
bool is_deleted() const { return m_data.first == reinterpret_cast<T1 *>(1); }
@ -99,7 +98,6 @@ protected:
key_data m_data;
public:
typedef key_data data;
entry() {}
unsigned get_hash() const { return m_data.hash(); }
bool is_free() const { return m_data.m_key1 == nullptr; }
bool is_deleted() const { return m_data.m_key1 == reinterpret_cast<Key1 *>(1); }

View file

@ -87,7 +87,7 @@ namespace sat {
};
const literal null_literal;
struct literal_hash : obj_hash<literal> {};
using literal_hash = obj_hash<literal>;
inline literal to_literal(unsigned x) { literal l; l.m_val = x; return l; }
inline bool operator<(literal const & l1, literal const & l2) { return l1.m_val < l2.m_val; }

View file

@ -24,7 +24,6 @@ Revision History:
class union_find_default_ctx {
public:
typedef trail_stack _trail_stack;
union_find_default_ctx() : m_stack() {}
void unmerge_eh(unsigned, unsigned) {}
void merge_eh(unsigned, unsigned, unsigned, unsigned) {}
@ -51,7 +50,6 @@ class union_find {
union_find & m_owner;
public:
mk_var_trail(union_find & o):m_owner(o) {}
~mk_var_trail() override {}
void undo() override {
m_owner.m_find.pop_back();
m_owner.m_size.pop_back();
@ -69,7 +67,6 @@ class union_find {
unsigned m_r1;
public:
merge_trail(union_find & o, unsigned r1):m_owner(o), m_r1(r1) {}
~merge_trail() override {}
void undo() override { m_owner.unmerge(m_r1); }
};