@@ -29,6 +29,7 @@ class Expression : public Tree {
29
29
virtual bool isConstant () = 0;
30
30
virtual ExpI type () = 0;
31
31
virtual ExpT apply () = 0;
32
+ virtual ~Expression () {}
32
33
protected:
33
34
template <typename T>
34
35
inline static const std::unordered_map<Operator,std::function<BoolT(T,T)>> Rel_ops{
@@ -42,22 +43,22 @@ class Expression : public Tree {
42
43
inline static const std::unordered_map<Operator,std::function<BoolT(BoolT,BoolT)>> BoolT_ops{
43
44
{ Operator::OR, [](IntT a, IntT b){ return a | b; } },
44
45
{ Operator::AND, [](IntT a, IntT b){ return a & b; } },
45
- { Operator::NOT, [](IntT a, IntT b){ return ~a; } }
46
+ { Operator::NOT, [](IntT a, [[maybe_unused]] IntT b){ return ~a; } }
46
47
};
47
48
inline static const std::unordered_map<Operator,std::function<IntT(IntT,IntT)>> IntT_ops{
48
49
{ Operator::plus, [](IntT a, IntT b){ return a + b; } },
49
50
{ Operator::minus, [](IntT a, IntT b){ return a - b; } },
50
51
{ Operator::multiply, [](IntT a, IntT b){ return a * b; } },
51
52
{ Operator::DIV, [](IntT a, IntT b){ return a / b; } },
52
53
{ Operator::MOD, [](IntT a, IntT b){ return a % b; } },
53
- { Operator::negative, [](IntT a, IntT b){ return -a; } }
54
+ { Operator::negative, [](IntT a, [[maybe_unused]] IntT b){ return -a; } }
54
55
};
55
56
inline static const std::unordered_map<Operator,std::function<RealT(RealT,RealT)>> RealT_ops{
56
57
{ Operator::plus, [](RealT a, RealT b){ return a + b; } },
57
58
{ Operator::minus, [](RealT a, RealT b){ return a - b; } },
58
59
{ Operator::multiply, [](RealT a, RealT b){ return a * b; } },
59
60
{ Operator::divide, [](RealT a, RealT b){ return a / b; } },
60
- { Operator::negative, [](RealT a, RealT b){ return -a; } }
61
+ { Operator::negative, [](RealT a, [[maybe_unused]] RealT b){ return -a; } }
61
62
};
62
63
inline static const std::unordered_map<Operator,std::function<StringT(StringT,StringT)>> StringT_ops{
63
64
{ Operator::plus, [](StringT a, StringT b){ return static_cast <StringT>(a.append (b)); } }
@@ -179,7 +180,7 @@ class Variable : public Expression {
179
180
ExpI tp;
180
181
public:
181
182
Variable (ExpI t, std::string_view l)
182
- : tp{ t }, label{ l } {}
183
+ : label{ l }, tp{ t } {}
183
184
virtual bool isConstant () override {
184
185
return false ;
185
186
}
0 commit comments