File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ struct ClusterData {
5050 {
5151 }
5252
53- bool operator ==(const ClusterData& rhs)
53+ bool operator ==(const ClusterData& rhs) const
5454 {
5555 return clusterid == rhs.clusterid && x == rhs.x && y == rhs.y && z == rhs.z && e == rhs.e ;
5656 }
Original file line number Diff line number Diff line change @@ -286,6 +286,8 @@ struct Descriptor {
286286 bool operator <(const Descriptor& other) const { return std::memcmp (this ->str , other.str , N) < 0 ; }
287287 bool operator !=(const Descriptor& other) const { return not this ->operator ==(other); }
288288
289+ // Convesion operators for comparison with their implicitly convertible types
290+ friend bool operator ==(const Descriptor& lhs, ImplicitConversion rhs) { return static_cast <ImplicitConversion>(lhs) == rhs; }
289291 // explicitly forbid comparison with e.g. const char* strings
290292 // use: value == Descriptor<N>("DESC") for the appropriate
291293 // template instantiation instead
Original file line number Diff line number Diff line change @@ -147,10 +147,10 @@ TEST_CASE("TestTableIteration")
147147
148148 b = tests2.begin ();
149149 REQUIRE (b != e);
150- REQUIRE ((b + 1 ) == (b + 1 ));
151- REQUIRE ((b + 7 ) != b);
152- REQUIRE ((b + 7 ) != e);
153- REQUIRE ((b + 8 ) == e);
150+ REQUIRE ((( b + 1 ) == (b + 1 ) ));
151+ REQUIRE ((( b + 7 ) != b) );
152+ REQUIRE ((( b + 7 ) != e) );
153+ REQUIRE ((( b + 8 ) == e) );
154154
155155 for (auto & t : tests2) {
156156 REQUIRE (t.x () == value / 4 );
You can’t perform that action at this time.
0 commit comments