RangeCondition(Type, Type);
virtual RangeCondition<T> *clone() const;
+ virtual bool equals(const Condition &) const;
virtual bool can_merge(const Condition &, const CompoundCondition &) const;
virtual RangeCondition<T> *merge(const std::vector<const Condition *> &, const CompoundCondition &) const;
virtual bool is_viable() const { return min<=max; }
return new RangeCondition<T>(min, max);
}
+template<typename T>
+bool RangeCondition<T>::equals(const Condition &other) const
+{
+ const RangeCondition<T> *other_range = dynamic_cast<const RangeCondition<T> *>(&other);
+ if(!other_range)
+ return false;
+
+ return (min==other_range->min && max==other_range->max);
+}
+
template<typename T>
bool RangeCondition<T>::can_merge(const Condition &other, const CompoundCondition &parent) const
{