diff --git a/src/json.hpp b/src/json.hpp index 64ca73b81..44626657c 100755 --- a/src/json.hpp +++ b/src/json.hpp @@ -1994,8 +1994,9 @@ class basic_json } // We only reach this line if we cannot compare values. In that case, - // we compare types. - return lhs_type < rhs_type; + // we compare types. Have to use operator< explicitly in order to + // not cause ambiguity on MS compiler + return operator<(lhs_type, rhs_type); } /// comparison: less than or equal diff --git a/test/unit.cpp b/test/unit.cpp index cedcb9ba8..ddff76039 100644 --- a/test/unit.cpp +++ b/test/unit.cpp @@ -6202,7 +6202,7 @@ TEST_CASE("lexicographical comparison operators") CAPTURE(i); CAPTURE(j); // check precomputed values - CHECK( (j_types[i] < j_types[j]) == expected[i][j] ); + CHECK( operator<(j_types[i], j_types[j]) == expected[i][j] ); } } }