| 33 | |
| 34 | template<class Predicate, class Compare> |
| 35 | static const ValueFlow::Value* getCompareValue(const std::list<ValueFlow::Value>& values, Predicate pred, Compare compare) |
| 36 | { |
| 37 | const ValueFlow::Value* result = nullptr; |
| 38 | for (const ValueFlow::Value& value : values) { |
| 39 | if (!pred(value)) |
| 40 | continue; |
| 41 | if (result) |
| 42 | result = &std::min(value, *result, [compare](const ValueFlow::Value& x, const ValueFlow::Value& y) { |
| 43 | return compare(x.intvalue, y.intvalue); |
| 44 | }); |
| 45 | else |
| 46 | result = &value; |
| 47 | } |
| 48 | return result; |
| 49 | } |
| 50 | |
| 51 | namespace { |
| 52 | struct Interval { |