From a7c69ec12aec23036bfdb6447e7c38b001a40f3d Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 15 Oct 2012 11:45:31 +1100 Subject: Fix up to build with clang (and fix another bug) - Remove exceptions - Remove dynamic casts The bug was relating to MaxStrategy not cleaning up the influence sets after propagating changes. I just added a call to .clear() and it seems fine. --- impl/Expression.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'impl/Expression.hpp') diff --git a/impl/Expression.hpp b/impl/Expression.hpp index eedaa52..00bc9cd 100644 --- a/impl/Expression.hpp +++ b/impl/Expression.hpp @@ -23,6 +23,10 @@ template struct Expression { virtual ~Expression() { } + virtual const MaxExpression* toMaxExpression() const { + return NULL; + } + virtual Domain eval(const VariableAssignment&) const = 0; virtual Domain eval(const VariableAssignment& rho, const MaxStrategy&) const { @@ -141,6 +145,10 @@ struct MaxExpression : public OperatorExpression { MaxExpression(const unsigned int& id, const Maximum& op, const std::vector*>& arguments) : OperatorExpression(op, arguments), _id(id) { } + const MaxExpression* toMaxExpression() const { + return this; + } + virtual Domain eval(const VariableAssignment& rho, const MaxStrategy& strat) const { return this->_arguments[strat.get(*this)]->eval(rho, strat); } -- cgit v1.2.3