diff --git a/src/json.hpp b/src/json.hpp old mode 100644 new mode 100755 index 269042f89..319f541cb --- a/src/json.hpp +++ b/src/json.hpp @@ -4286,7 +4286,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; + // Have to use operator< explicitly in order to + // not cause ambiguity on MS compiler + return operator<(lhs_type, rhs_type); } /*! diff --git a/test/unit.cpp b/test/unit.cpp old mode 100644 new mode 100755 index e38305190..27731b330 --- a/test/unit.cpp +++ b/test/unit.cpp @@ -6939,7 +6939,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]); } } }