Remove ambiguity for operator<
MSVC will try to build json object from value_t and use another operator<
This commit is contained in:
parent
0a9a5ab6b7
commit
a97509977f
@ -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
|
||||
|
||||
@ -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] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user