mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
24 lines
559 B
C++
24 lines
559 B
C++
#ifndef JAK1_MATCHPARAM_H
|
|
#define JAK1_MATCHPARAM_H
|
|
|
|
namespace util {
|
|
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); }
|
|
};
|
|
} // namespace util
|
|
|
|
#endif // JAK1_MATCHPARAM_H
|