Compilation issue with g++-7 (experimental)

line 6086: return *lhs.m_value.array < *rhs.m_value.array;
Should be changed to return (*lhs.m_value.array) < (*rhs.m_value.array); 
because the compiler reported:
/usr/local/include/nlohmann/json-2.1.0.hpp:6086:63: error: wrong number of template arguments (1, should be 2)
                      return *lhs.m_value.array < *rhs.m_value.array; // gcc-version < 7
                                                               ^~~~~
/usr/include/c++/7/array:94:12: note: provided for ‘template<class _Tp, long unsigned int _Nm> struct std::array’
     struct array
            ^~~~~
This commit is contained in:
ibroheem 2017-01-31 18:35:45 +01:00 committed by GitHub
parent 0164b10e10
commit 1638de2abc

View File

@ -6083,7 +6083,8 @@ class basic_json
{ {
case value_t::array: case value_t::array:
{ {
return *lhs.m_value.array < *rhs.m_value.array; //return *lhs.m_value.array < *rhs.m_value.array; // g++ version < 7
return (*lhs.m_value.array) < (*rhs.m_value.array); /// g++ 7
} }
case value_t::object: case value_t::object:
{ {