3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-11-20 12:11:38 -08:00
parent 1269776777
commit 1b768c9b3a
3 changed files with 29 additions and 2 deletions

View file

@ -56,6 +56,29 @@ public:
}
};
template<typename Ctx, typename T, typename Ts>
class scoped_value_trail : public trail<Ctx> {
T & m_value;
Ts & m_values;
public:
scoped_value_trail(T & value, Ts& values):
m_value(value),
m_values(values) {
}
~scoped_value_trail() override {
}
void undo(Ctx & ctx) override {
m_value = m_values.back();
m_values.pop_back();
}
};
template<typename Ctx>
class reset_flag_trail : public trail<Ctx> {
bool & m_value;