From 07f0e9308de56f52caa76eae0ab517b6fd47699c Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Tue, 10 Feb 2015 20:45:42 -0600 Subject: [PATCH] nullRef, since we had to add that kludge to 0.8.0 --- include/json/value.h | 3 ++- src/lib_json/json_value.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/json/value.h b/include/json/value.h index efc34ac..0c507a3 100644 --- a/include/json/value.h +++ b/include/json/value.h @@ -133,7 +133,8 @@ public: typedef Json::LargestUInt LargestUInt; typedef Json::ArrayIndex ArrayIndex; - static const Value& null; + static const Value& null; ///! We regret this reference to a global instance; prefer the simpler Value(). + static const Value& nullRef; ///! just a kludge for binary-compatibility; same as null /// Minimum signed integer value that can be stored in a Json::Value. static const LargestInt minLargestInt; /// Maximum signed integer value that can be stored in a Json::Value. diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index ed5aafe..f9139c7 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -36,6 +36,7 @@ namespace Json { static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 }; const unsigned char& kNullRef = kNull[0]; const Value& Value::null = reinterpret_cast(kNullRef); +const Value& Value::nullRef = null; const Int Value::minInt = Int(~(UInt(-1) / 2)); const Int Value::maxInt = Int(UInt(-1) / 2);