Remove ambiguity for operator<

MSVC will try to build json object from value_t and use another operator<
This commit is contained in:
Alexander Nevskiy 2015-06-13 00:49:33 +03:00
parent 0a9a5ab6b7
commit a97509977f
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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] );
}
}
}