You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd expect it to use == to compare elements (as implied by the Matcher's name 🙂)
Impacts are:
Prior to C++20, an operator!= needs to be supplied for user types (in addition to operator==).
If you are using C++20, the situation is happier as your compiler can rewrite != to use operator== (provided your compiler supports P1185R2)
If you're a monster and your operator== and operator!= are not the inverse of each other, the "wrong" operator would unexpectedly be used (again, based on the Matcher's name).
NB - In addition, != is used for approx matching here, though I don't think that would cause any of the issues noted above?
The vector
Equals
matcher uses!=
to compare elements:Catch2/src/catch2/matchers/catch_matchers_vector.hpp
Line 91 in 584973a
I'd expect it to use
==
to compare elements (as implied by the Matcher's name 🙂)Impacts are:
operator!=
needs to be supplied for user types (in addition tooperator==
).!=
to useoperator==
(provided your compiler supports P1185R2)operator==
andoperator!=
are not the inverse of each other, the "wrong" operator would unexpectedly be used (again, based on the Matcher's name).NB - In addition,
!=
is used forapprox
matching here, though I don't think that would cause any of the issues noted above?Catch2/src/catch2/matchers/catch_matchers_vector.hpp
Line 114 in 584973a
The text was updated successfully, but these errors were encountered: