support gcc 4.8.1 by abc100m · Pull Request #212 · nlohmann/json (original) (raw)

This is what I'm thinking:

@@ -123,7 +123,7 @@ using json = basic_json<>; #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" #endif #elif defined(GNUC) && !(defined(__ICC) || defined(__INTEL_COMPILER))

#endif @@ -10435,6 +10435,23 @@ class basic_json return object.release(); }

@@ -14579,9 +14596,7 @@ class basic_json }

         // insert to array and return iterator

@@ -14632,9 +14647,7 @@ class basic_json }

         // insert to array and return iterator

@@ -14696,12 +14709,10 @@ class basic_json }

     // insert to array and return iterator

@@ -14743,9 +14754,7 @@ class basic_json }

     // insert to array and return iterator

That would reduce maintenance burden by factoring out similar code into one place, and would also support GCC 4.8 partially. It could also be done with the #if.

(I've left in the old assert, but it seems to not be in the current .hpp, so you could remove it. It's just in one place now instead of three.)