From 1638de2abcaf1e4a450cb1735b052eb800fb95b3 Mon Sep 17 00:00:00 2001 From: ibroheem Date: Tue, 31 Jan 2017 18:35:45 +0100 Subject: [PATCH] Compilation issue with g++-7 (experimental) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 struct std::array’ struct array ^~~~~ --- src/json.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/json.hpp b/src/json.hpp index 5fdd83d6e..8e11f9bad 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -6083,7 +6083,8 @@ class basic_json { 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: {