Skip to content

Commit

Permalink
🐛 fixed regression nlohmann#1530
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Mar 20, 2019
1 parent 483a086 commit c790b9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5728,7 +5728,9 @@ class basic_json
switch (lhs_type)
{
case value_t::array:
return *lhs.m_value.array < *rhs.m_value.array;
// note parentheses are necessary, see
// https://github.com/nlohmann/json/issues/1530
return (*lhs.m_value.array < *rhs.m_value.array);

case value_t::object:
return *lhs.m_value.object < *rhs.m_value.object;
Expand Down
4 changes: 3 additions & 1 deletion single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18493,7 +18493,9 @@ class basic_json
switch (lhs_type)
{
case value_t::array:
return *lhs.m_value.array < *rhs.m_value.array;
// note parentheses are necessary, see
// https://github.com/nlohmann/json/issues/1530
return (*lhs.m_value.array < *rhs.m_value.array);

case value_t::object:
return *lhs.m_value.object < *rhs.m_value.object;
Expand Down

0 comments on commit c790b9f

Please sign in to comment.