diff --git a/Algorithm/test/pageparser.cxx b/Algorithm/test/pageparser.cxx index 14b24c670cfd6..7551c32d9d864 100644 --- a/Algorithm/test/pageparser.cxx +++ b/Algorithm/test/pageparser.cxx @@ -50,7 +50,7 @@ struct ClusterData { { } - bool operator==(const ClusterData& rhs) + bool operator==(const ClusterData& rhs) const { return clusterid == rhs.clusterid && x == rhs.x && y == rhs.y && z == rhs.z && e == rhs.e; } diff --git a/DataFormats/Headers/include/Headers/DataHeader.h b/DataFormats/Headers/include/Headers/DataHeader.h index ed25d0d7f5082..628cb86dd7bc8 100644 --- a/DataFormats/Headers/include/Headers/DataHeader.h +++ b/DataFormats/Headers/include/Headers/DataHeader.h @@ -286,6 +286,8 @@ struct Descriptor { bool operator<(const Descriptor& other) const { return std::memcmp(this->str, other.str, N) < 0; } bool operator!=(const Descriptor& other) const { return not this->operator==(other); } + // Convesion operators for comparison with their implicitly convertible types + friend bool operator==(const Descriptor& lhs, ImplicitConversion rhs) { return static_cast(lhs)==rhs; } // explicitly forbid comparison with e.g. const char* strings // use: value == Descriptor("DESC") for the appropriate // template instantiation instead diff --git a/Framework/Core/test/test_ASoA.cxx b/Framework/Core/test/test_ASoA.cxx index e6a537dab3dc9..467b15ec5bde0 100644 --- a/Framework/Core/test/test_ASoA.cxx +++ b/Framework/Core/test/test_ASoA.cxx @@ -147,10 +147,10 @@ TEST_CASE("TestTableIteration") b = tests2.begin(); REQUIRE(b != e); - REQUIRE((b + 1) == (b + 1)); - REQUIRE((b + 7) != b); - REQUIRE((b + 7) != e); - REQUIRE((b + 8) == e); + REQUIRE(((b + 1) == (b + 1))); + REQUIRE(((b + 7) != b)); + REQUIRE(((b + 7) != e)); + REQUIRE(((b + 8) == e)); for (auto& t : tests2) { REQUIRE(t.x() == value / 4);