Can't use overloaded comparison operator with Catch test
问题 I have a simple unit-test using Catch 2.11.1: #define CATCH_CONFIG_MAIN #include "catch.hpp" #include <utility> #include <any> namespace A::B { namespace C { struct S { }; } using type = std::pair<C::S, std::any>; } inline bool operator==(A::B::type const&, A::B::type const&) { return true; } TEST_CASE("test", "[test]") { auto t1 = std::make_pair(A::B::C::S(), std::any()); auto t2 = std::make_pair(A::B::C::S(), std::any()); REQUIRE(t1 == t2); } The above simple programs generates the