From a143d851f272bb8ed00cbfcd87622cc2bb9d92a5 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Tue, 27 Oct 2020 14:08:13 -0400 Subject: [PATCH] add != operators for IcebergQuantity and optional --- .../cmds/spartan/md/mdp3/common/mdp3_quantity_operators.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/sparkd/cmds/spartan/md/mdp3/common/mdp3_quantity_operators.h b/src/server/sparkd/cmds/spartan/md/mdp3/common/mdp3_quantity_operators.h index 63cbe6c6e..e01966958 100644 --- a/src/server/sparkd/cmds/spartan/md/mdp3/common/mdp3_quantity_operators.h +++ b/src/server/sparkd/cmds/spartan/md/mdp3/common/mdp3_quantity_operators.h @@ -48,9 +48,15 @@ ICEBERG_QTY_COMP_OP(!=) inline bool operator==(const IcebergQuantity& lhs, const std::optional& rhs) { return rhs.has_value() && lhs == rhs.value(); } +inline bool operator!=(const IcebergQuantity& lhs, const std::optional& rhs) { + return !(lhs == rhs); +} inline bool operator==(const std::optional& lhs, const IcebergQuantity& rhs) { return rhs == lhs; } +inline bool operator!=(const std::optional& lhs, const IcebergQuantity& rhs) { + return !(rhs == lhs); +} inline bool operator==(const std::optional& lhs, const std::optional& rhs) { return lhs.has_value() ? rhs.has_value() && lhs.value() == rhs.value() : !rhs.has_value(); }