Skip to content

Commit 07f0e93

Browse files
committed
nullRef, since we had to add that kludge to 0.8.0
1 parent 052050d commit 07f0e93

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/json/value.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ class JSON_API Value {
133133
typedef Json::LargestUInt LargestUInt;
134134
typedef Json::ArrayIndex ArrayIndex;
135135

136-
static const Value& null;
136+
static const Value& null; ///! We regret this reference to a global instance; prefer the simpler Value().
137+
static const Value& nullRef; ///! just a kludge for binary-compatibility; same as null
137138
/// Minimum signed integer value that can be stored in a Json::Value.
138139
static const LargestInt minLargestInt;
139140
/// Maximum signed integer value that can be stored in a Json::Value.

src/lib_json/json_value.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ namespace Json {
3636
static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 };
3737
const unsigned char& kNullRef = kNull[0];
3838
const Value& Value::null = reinterpret_cast<const Value&>(kNullRef);
39+
const Value& Value::nullRef = null;
3940

4041
const Int Value::minInt = Int(~(UInt(-1) / 2));
4142
const Int Value::maxInt = Int(UInt(-1) / 2);

0 commit comments

Comments
 (0)