diff --git a/src/json.hpp b/src/json.hpp old mode 100644 new mode 100755 index 9511f02cc..319f541cb --- a/src/json.hpp +++ b/src/json.hpp @@ -2931,8 +2931,8 @@ class basic_json */ template ::value or - std::is_same::value + std::is_same::value or + std::is_same::value , int>::type = 0> InteratorType erase(InteratorType first, InteratorType last) @@ -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); } /*! @@ -4852,7 +4854,7 @@ class basic_json }; /// an iterator value - union internal_iterator + struct internal_iterator { /// iterator for JSON objects typename object_t::iterator object_iterator; diff --git a/test/unit.cpp b/test/unit.cpp old mode 100644 new mode 100755 index e38305190..f1863fb7b --- 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]); } } } @@ -8163,9 +8163,11 @@ TEST_CASE("parser class") SECTION("escaped") { // quotation mark "\"" - CHECK(json::parser("\"\\\"\"").parse() == R"("\"")"_json); + auto r1 = R"("\"")"_json; + CHECK(json::parser("\"\\\"\"").parse() == r1); // reverse solidus "\\" - CHECK(json::parser("\"\\\\\"").parse() == R"("\\")"_json); + auto r2 = R"("\\")"_json; + CHECK(json::parser("\"\\\\\"").parse() == r2); // solidus CHECK(json::parser("\"\\/\"").parse() == R"("/")"_json); // backspace @@ -9738,7 +9740,8 @@ TEST_CASE("regression tests") { auto s = "[\"\\\"foo\\\"\"]"; json j = json::parse(s); - CHECK(j == R"(["\"foo\""])"_json); + auto expected = R"(["\"foo\""])"_json; + CHECK(j == expected); } }