2020-09-13 21:32:55 -04:00
|
|
|
#pragma once
|
|
|
|
|
2021-01-06 20:04:15 -05:00
|
|
|
namespace decompiler {
|
2020-08-22 22:30:12 -04:00
|
|
|
template <typename T>
|
|
|
|
struct MatchParam {
|
|
|
|
MatchParam() { is_wildcard = true; }
|
|
|
|
|
|
|
|
// intentionally not explicit so you don't have to put MatchParam<whatever>(blah) everywhere
|
|
|
|
MatchParam(T x) {
|
|
|
|
value = x;
|
|
|
|
is_wildcard = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
T value;
|
|
|
|
bool is_wildcard = true;
|
|
|
|
|
|
|
|
bool operator==(const T& other) const { return is_wildcard || (value == other); }
|
|
|
|
bool operator!=(const T& other) const { return !(*this == other); }
|
2021-01-06 20:04:15 -05:00
|
|
|
};
|
|
|
|
} // namespace decompiler
|