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

fix vector<> to support non-POD types

adjust code to std::move and avoid unnecessary/illegal
This commit is contained in:
Nuno Lopes 2017-10-10 17:24:22 +01:00
parent 4d1acadabb
commit 9b54b4e784
35 changed files with 253 additions and 95 deletions

View file

@ -121,6 +121,20 @@ public:
explicit parameter(unsigned ext_id, bool):m_kind(PARAM_EXTERNAL), m_ext_id(ext_id) {}
parameter(parameter const&);
parameter(parameter && other) noexcept : m_kind(other.m_kind) {
switch (other.m_kind) {
case PARAM_INT: m_int = other.get_int(); break;
case PARAM_AST: m_ast = other.get_ast(); break;
case PARAM_SYMBOL: m_symbol = other.m_symbol; break;
case PARAM_RATIONAL: m_rational = 0; std::swap(m_rational, other.m_rational); break;
case PARAM_DOUBLE: m_dval = other.m_dval; break;
case PARAM_EXTERNAL: m_ext_id = other.m_ext_id; break;
default:
UNREACHABLE();
break;
}
}
~parameter();
parameter& operator=(parameter const& other);