add equality operator to Action::Condition
also make it default constructible
This commit is contained in:
@@ -69,6 +69,7 @@ enum class Comparator {
|
||||
};
|
||||
|
||||
|
||||
Condition() = default;
|
||||
Condition(const std::vector<std::string>& tokens, const Location& location);
|
||||
|
||||
|
||||
@@ -77,6 +78,8 @@ enum class Comparator {
|
||||
Logical logic = Logical::END;
|
||||
Comparator cmp = Comparator::INVALID;
|
||||
std::string cmp_string;
|
||||
|
||||
bool operator==(const Condition& data) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -127,5 +127,14 @@ Condition::Condition(const std::vector<std::string>& tokens, const Location& loc
|
||||
}
|
||||
|
||||
|
||||
bool Condition::operator==(const Condition& data) const {
|
||||
return lhs == data.lhs &&
|
||||
rhs == data.rhs &&
|
||||
logic == data.logic &&
|
||||
cmp == data.cmp &&
|
||||
cmp_string == data.cmp_string;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user