add != operators for IcebergQuantity and optional<IcebergQuantity>

This commit is contained in:
John Colvin committed 2020-10-27 17:40:58 -04:00
1 parent a25f089810
commit a143d851f2
1 file changed
+6
@@ -48,9 +48,15 @@ ICEBERG_QTY_COMP_OP(!=)
inline bool operator==(const IcebergQuantity& lhs, const std::optional<IcebergQuantity>& rhs) {
return rhs.has_value() && lhs == rhs.value();
}
inline bool operator!=(const IcebergQuantity& lhs, const std::optional<IcebergQuantity>& rhs) {
return !(lhs == rhs);
}
inline bool operator==(const std::optional<IcebergQuantity>& lhs, const IcebergQuantity& rhs) {
return rhs == lhs;
}
inline bool operator!=(const std::optional<IcebergQuantity>& lhs, const IcebergQuantity& rhs) {
return !(rhs == lhs);
}
inline bool operator==(const std::optional<IcebergQuantity>& lhs, const std::optional<IcebergQuantity>& rhs) {
return lhs.has_value() ? rhs.has_value() && lhs.value() == rhs.value() : !rhs.has_value();
}